public void CrearPartida() { var jugadorLocal = new Player(0, "holder"); comPort.Write(Instruccion.FormarTrama( Instruccion.FormarPrimerByte(jugadorLocal.GetIdAsString(), jugadorLocal.GetIdAsString(), Instruccion.PrimerByte.INICIAR_PARTIDA), Instruccion.FormarSegundoByte( Instruccion.SegundoByte.CONFIGURAR_PARTIDA + Instruccion.SegundoByte.CONTAR, jugadorLocal.GetIdAsString())), 0, 4); }
public void AnunciarJugadores(string origen, string destino, string numeroFaltante) { byte[] toSend = Instruccion.FormarTrama( Instruccion.FormarPrimerByte(origen, destino, Instruccion.PrimerByte.INICIAR_PARTIDA), Instruccion.FormarSegundoByte( Instruccion.SegundoByte.CONFIGURAR_PARTIDA + Instruccion.SegundoByte.ANUNCIAR, numeroFaltante)); foreach (byte b in toSend) { Trace.WriteLine(Instruccion.ByteToString(b)); } comPort.Write(toSend, 0, 4); }