GR.Gambling.Blackjack.Game.Upcard C# (CSharp) Method

Upcard() public method

public Upcard ( ) : Card
return Card
        public Card Upcard()
        {
            return dealer_hand[0];
        }

Usage Example

示例#1
0
        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);
        }
All Usage Examples Of GR.Gambling.Blackjack.Game::Upcard