GR.Gambling.Blackjack.BasicStrategy.Evaluate C# (CSharp) Method

Evaluate() private method

private Evaluate ( Card upcard, Hand hand ) : List
upcard Card
hand Hand
return List
        private List<ActionEv> Evaluate(Card upcard, Hand hand)
        {
            shell.StandardInput.WriteLine(upcard.PointValue);
            shell.StandardInput.WriteLine(hand.Count);

            foreach (Card card in hand)
                shell.StandardInput.WriteLine(card.PointValue);

            string line = "";
            List<ActionEv> actions = new List<ActionEv>();
            while (true)
            {
                line = shell.StandardOutput.ReadLine();

                if (line.StartsWith("done"))
                    break;

                ActionEv action_ev = new ActionEv();

                string[] param = line.Split(new char[] { ' ' });

                action_ev.Ev = double.Parse(param[1]);
                if (param[0] == "Surrender")
                    action_ev.Action = ActionType.Surrender;
                else if (param[0] == "Hit")
                    action_ev.Action = ActionType.Hit;
                else if (param[0] == "Stand")
                    action_ev.Action = ActionType.Stand;
                else if (param[0] == "Double")
                    action_ev.Action = ActionType.Double;
                else if (param[0] == "Split")
                    action_ev.Action = ActionType.Split;
                else
                    Console.WriteLine("BIG FUCKING UPS!!!!!");

                actions.Add(action_ev);
            }

            actions.Sort(delegate(ActionEv ae1, ActionEv ae2) { return ae2.Ev.CompareTo(ae1.Ev); });

            /*Console.WriteLine("Upcard: " + upcard + " Hand: " + hand);
            foreach (ActionEv ae in actions)
                Console.WriteLine(ae.Action + " " + ae.Ev);
            Console.ReadKey();*/

            return actions;
        }