コード例 #1
0
        public AnimatedHandGameComponent(int place, Hand hand, Cards_FrameWork.Game.CardsGame cardGame)
            : base(cardGame, null)
        {
            Place              = place;
            hand.ReceivedCard += Hand_ReceiveCard;
            hand.LostCard     += Hand_LostCard;

            if (place == -1)
            {
                CurrentPosition = CardGame.GameTable.DealerPosition;
            }
            else
            {
                CurrentPosition = CardGame.GameTable[place];
            }

            for (int cardIndex = 0; cardIndex < hand.Count; cardIndex++)
            {
                AnimatedCardsGameComponent animatedCardGameComponent = new AnimatedCardsGameComponent(hand[cardIndex], CardGame)
                {
                    CurrentPosition = CurrentPosition + new Vector2(30 * cardIndex, 0)
                };
                heldAnimationCards.Add(animatedCardGameComponent);
                Game.Components.Add(animatedCardGameComponent);
            }
            Game.Components.ComponentRemoved += Components_ComponentRemoved;
        }
コード例 #2
0
 public BetGameComponent(List <Cards_FrameWork.Player.Player> players, ScreenManager.InputState input, string theme, Cards_FrameWork.Game.CardsGame cardGame)
     : base(cardGame.Game)
 {
     this.players  = players;
     this.theme    = theme;
     this.cardGame = cardGame;
     this.input    = input;
     chipAssets    = new Dictionary <int, Texture2D>();
 }
コード例 #3
0
        private static void CalculateValue(Hand hand, Cards_FrameWork.Game.CardsGame game, out int value, out bool considerAce)
        {
            value       = 0;
            considerAce = false;

            for (int cardIndex = 0; cardIndex < hand.Count; cardIndex++)
            {
                value += game.CardValue(hand[cardIndex]);

                if (hand[cardIndex].Value == CardValue.Ace)
                {
                    considerAce = true;
                }

                if (considerAce && value + 10 > 21)
                {
                    considerAce = false;
                }
            }
        }
コード例 #4
0
 public Player(string name, Cards_FrameWork.Game.CardsGame game)
 {
     Name = name;
     Game = game;
     Hand = new Hand();
 }
 public BlackJackAnimatedPlayerHandComponent(int place, Vector2 offSet, Hand hand, Cards_FrameWork.Game.CardsGame cardGame)
     : base(place, hand, cardGame)
 {
     this.offSet = offSet;
 }
コード例 #6
0
 public Button(string regularTexture, string pressedTexture, ScreenManager.InputState input, Cards_FrameWork.Game.CardsGame cardGame)
     : base(cardGame, null)
 {
     this.input          = input;
     this.regularTexture = regularTexture;
     this.pressedTexture = pressedTexture;
 }
コード例 #7
0
 public BlackJackAIPlayer(string name, Cards_FrameWork.Game.CardsGame game)
     : base(name, game)
 {
 }
コード例 #8
0
 public BlackjackPlayer(string name, Cards_FrameWork.Game.CardsGame game)
     : base(name, game)
 {
     Balance         = 500;
     CurrentHandType = HandTypes.First;
 }
コード例 #9
0
 public BlackJackAnimatedDealerHandComponent(int place, Hand hand, Cards_FrameWork.Game.CardsGame cardGame)
     : base(place, hand, cardGame)
 {
 }