GR.Gambling.Blackjack.BonusPairsAgent.ValidateActions C# (CSharp) Method

ValidateActions() public method

public ValidateActions ( CardSet active_hand, List available_actions ) : void
active_hand CardSet
available_actions List
return void
        public void ValidateActions(CardSet active_hand, List<ActionType> available_actions)
        {
            if (!available_actions.Contains(ActionType.Stand)) throw new Exception("ValidateActions failed: no stand");
            if (!available_actions.Contains(ActionType.Hit)) throw new Exception("ValidateActions failed: no hit");

            if (active_hand.Count == 2)
            {
                if (!available_actions.Contains(ActionType.Double)) throw new Exception("ValidateActions failed: no double");

                if (active_hand[0].PointValue == active_hand[1].PointValue && split_count < max_splits)
                {
                    if (!available_actions.Contains(ActionType.Split)) throw new Exception("ValidateActions failed: no split");
                }

                if (split_count == 0)
                {
                    if (!available_actions.Contains(ActionType.Surrender)) throw new Exception("ValidateActions failed: no surrender");
                }
            }
        }