Esempio n. 1
0
        public static GameStatus CreateForMove(GameStatus status, GameMove move, GameMoveResultType result, Token attacker, Token defender)
        {
            var active = !result.IsGameOver();
            var winner = result.GetWinner(status.CurrentPlayer, status.OtherPlayer);
            
            // switch current player
            var currentPlayer = status.OtherPlayer;
            var otherPlayer = status.CurrentPlayer;

            return new GameStatus(currentPlayer, otherPlayer, winner, active, move, result, attacker, defender);
        }
Esempio n. 2
0
 public GameStatus(
     Player currentPlayer, 
     Player otherPlayer,
     Player winner,
     bool gameActive,
     GameMove currentMove,
     GameMoveResultType currentMoveResult,
     Token attackerToken,
     Token defenderToken)
 {
     this.CurrentPlayer = currentPlayer;
     this.OtherPlayer = otherPlayer;
     this.Winner = winner;
     this.GameActive = gameActive;
     this.CurrentMove = currentMove;
     this.CurrentMoveResult = currentMoveResult;
     this.AttackerToken = attackerToken;
     this.DefenderToken = defenderToken;
 }