AIsOfCatan.HumanAgent.BeforeDiceRoll C# (CSharp) Method

BeforeDiceRoll() public method

public BeforeDiceRoll ( IGameState state, IGameActions actions ) : void
state IGameState
actions IGameActions
return void
        public void BeforeDiceRoll(IGameState state, IGameActions actions)
        {
            hasPlayedDevCard = false;
            if (!state.GetOwnDevelopmentCards().Any(dc => dc != DevelopmentCard.VictoryPoint))
                return; //No cards to play
            Console.WriteLine("Do you want to use a Development Card before roling the dice? Y/N");
            var r = Console.ReadLine() ?? "";
            if (!r.ToLower().StartsWith("y")) return;
            PlayDevelopmentCard(state, actions);
        }