Esempio n. 1
0
        public RobberStealState(IGameTurn turn, IBoard board)
        {
            if (turn == null)
                throw new ArgumentNullException(nameof(turn));
            if (board == null)
                throw new ArgumentNullException(nameof(board));
            if (board.Robber == null)
                throw new ArgumentNullException(nameof(board.Robber));
            this.turn = turn;

            //CvB todo maybe cleaner to get those values from a class that handles the actual stealing?
            var stealablePlayers = board.GetPlayers(board.Robber.CurrentTile);
            if (!stealablePlayers.Any() || stealablePlayers.All(p => p == turn.Player))
                turn.NextFlowState();
        }