コード例 #1
0
ファイル: Deck.cs プロジェクト: jwanglof/TDDD49
        /*
         * Returns the cards specified by the playerEntity
         */
        public List<Card> getPlayerEntityCards(Players playerEntity)
        {
            List<Card> cards = new List<Card>();
            cards.Add(findCard(playerEntity.card1_suit, playerEntity.card1_value));
            cards.Add(findCard(playerEntity.card2_suit, playerEntity.card2_value));
            cards.Add(findCard(playerEntity.card3_suit, playerEntity.card3_value));
            cards.Add(findCard(playerEntity.card4_suit, playerEntity.card4_value));
            cards.Add(findCard(playerEntity.card5_suit, playerEntity.card5_value));

            foreach (Card card in cards)
                cardsInDeck.Remove(card);

            return cards;
        }
コード例 #2
0
ファイル: Player.xaml.cs プロジェクト: jwanglof/TDDD49
        /*
        * Returns an entity of the object
        */
        public Players getEntity()
        {
            Players entity = new Players();

            entity.card1_suit = hand[0].getSuit();
            entity.card1_value = hand[0].getNumber();
            entity.card2_suit = hand[1].getSuit();
            entity.card2_value = hand[1].getNumber();
            entity.card3_suit = hand[2].getSuit();
            entity.card3_value = hand[2].getNumber();
            entity.card4_suit = hand[3].getSuit();
            entity.card4_value = hand[3].getNumber();
            entity.card5_suit = hand[4].getSuit();
            entity.card5_value = hand[4].getNumber();

            entity.money = money.getMoney();
            entity.myTurn = myTurn;
            entity.prevBet = prevBet;

            return entity;
        }
コード例 #3
0
ファイル: Player.xaml.cs プロジェクト: jwanglof/TDDD49
        /*
         * Modifies this object according the the entity properties
         */
        public void parsePlayerEntity(Players entity, List<Card> hand)
        {
            //Load turn
            myTurn = entity.myTurn;
            cardGrid.IsEnabled = myTurn;
            if (myTurn)
            {
                turnGrid.Visibility = System.Windows.Visibility.Visible;
                betGrid.IsEnabled = true;
            }
            else
            {
                turnGrid.Visibility = System.Windows.Visibility.Hidden;
                betGrid.IsEnabled = false;
            }

            //Load bet
            prevBet = entity.prevBet;
            betCounter.Text = prevBet.ToString();
            money.setMoney(entity.money);

            //Load cards
            this.hand = hand;
            updateHand();
        }