public override ActionType GetBestAction(Game game)
{
Console.WriteLine("Upcard: " + game.Upcard() + " | Hand: " +
game.PlayerHandSet.ActiveHand + " (" +
game.PlayerHandSet.ActiveHand.PointCount() + ")");
if (game.IsValidAction(ActionType.Hit))
{
Console.Write("(H)it ");
}
if (game.IsValidAction(ActionType.Stand))
{
Console.Write("(S)tand ");
}
if (game.IsValidAction(ActionType.Surrender))
{
Console.Write("Sur(r)ender ");
}
if (game.IsValidAction(ActionType.Split))
{
Console.Write("S(p)lit ");
}
if (game.IsValidAction(ActionType.Double))
{
Console.Write("(D)ouble ");
}
string input = Console.ReadLine();
if (input[0] == 'h')
{
return(ActionType.Hit);
}
if (input[0] == 's')
{
return(ActionType.Stand);
}
if (input[0] == 'r')
{
return(ActionType.Surrender);
}
if (input[0] == 'p')
{
return(ActionType.Split);
}
if (input[0] == 'd')
{
return(ActionType.Double);
}
Console.WriteLine("Ops");
return(ActionType.Surrender);
}