public override void PlayFromSave() { localInterface = null; Material[] pieces = GetMaterial(); highlightedSquares.Clear(); twoPlayers = true; whitePlayer = new LocalPlayer(this, true, null, pieces[0]); blackPlayer = new LocalPlayer(this, false, null, pieces[1]); moveLabel.Text = ""; turnLabel.Text = (turn == Turn.LOCAL_WHITE ? "White's" : "Black's") + " turn."; whiteOnBottom = !flipBoard || turn == Turn.LOCAL_WHITE; mnu.EnableEntry("Options", "Flip Board Each Turn"); NewGameMenuUpdate(true, false, false); }
public override void SetupServer(NetworkInterface comm) { comm.Connected += new OpponentConnected(ClientConnected); localInterface = comm; turn = Turn.NOT_IN_SESSION; moveLabel.Text = ""; turnLabel.Text = "Waiting for opponent to connect."; NewGameMenuUpdate(false, false, false); }
internal LocalPlayer(PieceColor color, NetworkInterface remoteOpponent) : base(color) { this.remoteOpponent = remoteOpponent; }
public override void PlayLocal() { localInterface = null; ClearAllSquares(); twoPlayers = true; yellowPlayer = new LocalPlayer(PieceColor.YELLOW, null); redPlayer = new LocalPlayer(PieceColor.RED, null); turn = Turn.LOCAL_YELLOW; moveLabel.Text = ""; turnLabel.Text = "Yellow's turn."; NewGameMenuUpdate(true, false, false); }
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); }
public override void SetupServer(NetworkInterface comm) { comm.Connected += new OpponentConnected(ClientConnected); localInterface = comm; turn = Turn.NOT_IN_SESSION; moveLabel.Text = ""; turnLabel.Text = "Waiting for opponent to connect."; mnu.DisableEntry("Options", "Flip Board Each Turn"); NewGameMenuUpdate(false, false, false); }
public override void PlayFromSave() { localInterface = null; twoPlayers = true; blackPlayer = new LocalPlayer(PieceColor.BLACK, null); whitePlayer = new LocalPlayer(PieceColor.WHITE, null); moveLabel.Text = ""; turnLabel.Text = (turn == Turn.LOCAL_BLACK ? "Black" : "White") + "'s turn."; NewGameMenuUpdate(true, false, false); }
public abstract void PlayServer(NetworkInterface comm);
public abstract void SetupServer(NetworkInterface comm);
public GameWindow(GameBoard board, NetworkInterface comm, bool canExitToGameSelect) { InitializeComponent(board); network = (comm != null); exitChoice = ExitType.DESKTOP; board.SetFrameComponents(turnIndicator, sessionStatus, moveIndicator, mnuForfeit, mnuAskTie, mnuRestart, new GameSpecificMenuEntries(mnuStrip)); if (network) { this.mnuOpen.Enabled = false; this.mnuSave.Enabled = false; } if (!canExitToGameSelect) this.mnuExitToChooseGame.Enabled = false; }
public abstract void PlayClient(NetworkInterface comm);
internal LocalPlayer(ChessBoard board, bool white, NetworkInterface remoteOpponent, Material material) : base(white, material) { this.remoteOpponent = remoteOpponent; }
public override void PlayServer(NetworkInterface comm) { comm.Disconnected += new OpponentDisconnected(comm_Disconnected); localInterface = comm; ClearAllSquares(); twoPlayers = false; NetworkPlayer p = new NetworkPlayer(PieceColor.BLACK); blackPlayer = p; whitePlayer = new LocalPlayer(PieceColor.WHITE, comm); comm.Handler = new OmokPacketHandler(p, this); turn = Turn.NETWORK_OPPONENT_BLACK; moveLabel.Text = ""; turnLabel.Text = "Black's turn."; NewGameMenuUpdate(false, true, true); }
public override void PlayLocal() { localInterface = null; ClearAllSquares(); twoPlayers = true; blackPlayer = new LocalPlayer(PieceColor.BLACK, null); whitePlayer = new LocalPlayer(PieceColor.WHITE, null); turn = Turn.LOCAL_BLACK; moveLabel.Text = ""; turnLabel.Text = "Black's turn."; NewGameMenuUpdate(true, false, false); }
public override void PlayLocal() { localInterface = null; Material[] pieces = SetDefaultPieces(); highlightedSquares.Clear(); twoPlayers = true; whitePlayer = new LocalPlayer(this, true, null, pieces[0]); blackPlayer = new LocalPlayer(this, false, null, pieces[1]); turn = Turn.LOCAL_WHITE; whiteOnBottom = true; moveLabel.Text = ""; turnLabel.Text = "White's turn."; mnu.EnableEntry("Options", "Flip Board Each Turn"); NewGameMenuUpdate(true, false, false); }
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(); }
public override void PlayServer(NetworkInterface comm) { comm.Disconnected += new OpponentDisconnected(comm_Disconnected); localInterface = comm; Material[] pieces = SetDefaultPieces(); highlightedSquares.Clear(); twoPlayers = false; NetworkPlayer p = new NetworkPlayer(this, true, pieces[0]); whitePlayer = p; blackPlayer = new LocalPlayer(this, false, comm, pieces[1]); comm.Handler = new ChessPacketHandler(p, this); turn = Turn.NETWORK_OPPONENT_WHITE; moveLabel.Text = ""; turnLabel.Text = "White's turn."; whiteOnBottom = false; mnu.DisableEntry("Options", "Flip Board Each Turn"); NewGameMenuUpdate(false, true, true); }
public override void PlayFromSave() { localInterface = null; twoPlayers = true; yellowPlayer = new LocalPlayer(PieceColor.YELLOW, null); redPlayer = new LocalPlayer(PieceColor.RED, null); moveLabel.Text = ""; turnLabel.Text = (turn == Turn.LOCAL_YELLOW ? "Yellow" : "Red") + "'s turn."; NewGameMenuUpdate(true, false, false); }
private void ClientConnected(NetworkInterface comm, EndPoint remoteAddress) { Console.WriteLine("Cliented connected from " + remoteAddress); PlayClient(comm); }
public override void PlayClient(NetworkInterface comm) { comm.Disconnected += new OpponentDisconnected(comm_Disconnected); ClearAllSquares(); twoPlayers = false; blackPlayer = new LocalPlayer(PieceColor.BLACK, comm); NetworkPlayer p = new NetworkPlayer(PieceColor.WHITE); whitePlayer = p; comm.Handler = new OmokPacketHandler(p, this); turn = Turn.LOCAL_BLACK; moveLabel.Text = ""; turnLabel.Text = "Black's turn."; NewGameMenuUpdate(false, true, true); Redraw(); }