GR.Gambling.Blackjack.DualStrategy.GetBestAction C# (CSharp) Method

GetBestAction() public method

public GetBestAction ( Game game ) : ActionType
game Game
return ActionType
        public override ActionType GetBestAction(Game game)
        {
            ActionType a1 = primary.GetBestAction(game);
            ActionType a2 = secondary.GetBestAction(game);

            if (a1 != a2 && !IsDiff)
            {
                List<ActionEv> l1 = primary.GetActions(game);
                List<ActionEv> l2 = secondary.GetActions(game);

                int m = 0;
                if (l1 != null) m = l1.Count;
                if (l2 != null && l2.Count > m) m = l2.Count;

                Console.WriteLine("STRATEGY MISMATCH");
                Console.WriteLine();
                Console.WriteLine(game.ToString());

                Console.WriteLine(string.Format("{0,-25}    {1,-25}", primary.GetType(), secondary.GetType()));
                Console.WriteLine();

                Console.WriteLine(string.Format("{0,-25}    {1,-25}", a1, a2));
                Console.WriteLine();

                for (int i = 0; i < m; i++)
                {
                    ActionEv e1 = new ActionEv(), e2 = new ActionEv();

                    if (l1 != null && i < l1.Count) e1 = l1[i];
                    if (l2 != null && i < l2.Count) e2 = l2[i];

                    Console.WriteLine(string.Format("{0,-25}    {1,-25}", e1, e2));
                }

                Console.WriteLine();
                Console.WriteLine();
                Console.WriteLine();
            }

            return a1;
        }