コード例 #1
0
 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);
 }
コード例 #2
0
 internal Connect4PacketHandler(NetworkPlayer p, Connect4Board board)
 {
     this.player = p;
     this.board = board;
 }
コード例 #3
0
        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();
        }