Exemple #1
0
 public void GenerateNewGame(Player opponent, bool thisPlayersTurn, int gameID)
 {
     if (!menuPages.ContainsKey(MenuPages.InGame))
         menuPages.Add(MenuPages.InGame, new Menus.GameBoard(this, ProtocolHandler, Player, opponent, thisPlayersTurn, gameID));
     else
         menuPages[MenuPages.InGame] = new Menus.GameBoard(this, ProtocolHandler, Player, opponent, thisPlayersTurn, gameID);
     this.Content = menuPages[MenuPages.InGame];
 }
Exemple #2
0
        /// <summary>
        /// Attempts to flag this spot for a player.
        /// </summary>
        /// <param name="player">The player who wishes to move into this spot.</param>
        /// <returns>True if the move was successful, false if this spot has been moved to already.</returns>
        public bool AttemptMove(Player player)
        {
            if (this.Symbol == default(char))
            {
                Symbol = player.Symbol;
                Label.Content = Symbol;

                return true;
            }

            return false;
        }