コード例 #1
0
        bool CanPerform(Action action, Hand hand)
        {
            switch (action)
            {
            case Action.Stand:
            case Action.Hit:
                return(true);

            case Action.Double:
                return(hand.InitialBet <= Money);

            case Action.Split:
                return(CardUtils.IsPair(hand.Cards) && hand.InitialBet <= Money);

            case Action.Surrender:
                return(hand.Cards.Count == 2);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }