public override void PlayServer(NetworkInterface comm) { comm.Disconnected += new OpponentDisconnected(comm_Disconnected); localInterface = comm; ClearAllSquares(); twoPlayers = false; NetworkPlayer p = new NetworkPlayer(PieceColor.YELLOW); yellowPlayer = p; redPlayer = new LocalPlayer(PieceColor.RED, comm); comm.Handler = new Connect4PacketHandler(p, this); turn = Turn.NETWORK_OPPONENT_YELLOW; moveLabel.Text = ""; turnLabel.Text = "Yellow's turn."; NewGameMenuUpdate(false, true, true); }
internal Connect4PacketHandler(NetworkPlayer p, Connect4Board board) { this.player = p; this.board = board; }
public override void PlayClient(NetworkInterface comm) { comm.Disconnected += new OpponentDisconnected(comm_Disconnected); ClearAllSquares(); twoPlayers = false; yellowPlayer = new LocalPlayer(PieceColor.YELLOW, comm); NetworkPlayer p = new NetworkPlayer(PieceColor.RED); redPlayer = p; comm.Handler = new Connect4PacketHandler(p, this); turn = Turn.LOCAL_YELLOW; moveLabel.Text = ""; turnLabel.Text = "Yellow's turn."; NewGameMenuUpdate(false, true, true); Redraw(); }