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

TakeInsurance() public method

public TakeInsurance ( CardSet seen_cards ) : bool
seen_cards CardSet
return bool
        public override bool TakeInsurance(CardSet seen_cards)
        {
            Shoe tmp_shoe = shoe.Copy();
            tmp_shoe.Remove(seen_cards);

            double insurance_ev = Eval.InsuranceEv(current_bet, tmp_shoe.ToArray());

            if (insurance_ev >= 0.0)
            {
                game_logger.Insurance(true);
                insurance_taken = true;
                return true;
            }

            return false;
        }

Usage Example

 public override bool TakeInsurance(Game game)
 {
     return(agent.TakeInsurance(GetSeenCards(game, false)));
 }