コード例 #1
0
        public static bool IsValidCardPool(AbstractDeck input_deck)
        {
            string CardPool = input_deck.GetCardPool();

            if (CardPool == "")
            {
                Console.WriteLine("ERROR >>> Card Pool is empty");
                return(false);
            }
            return(true);
        }
コード例 #2
0
 public static bool DeckHasCard(AbstractCard card, AbstractDeck deck)
 {
     if (card == null)
     {
         throw new exceptions.NullCardException();
     }
     AbstractCard[] CardList = deck.GetArrayOfCardsInDeck();
     for (int i = 0; i < CardList.Length; i++)
     {
         if (CardList[i].GetID() == card.GetID())
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #3
0
 public static bool IsFactionInPool(AbstractDeck input_deck, string faction)
 {
     if (!IsValidCardPool(input_deck))
     {
         return(false);
     }
     string[] faction_list = GetListDeckFactions(input_deck);
     foreach (string comparitor_faction in faction_list)
     {
         if (faction == comparitor_faction)
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #4
0
        public static string[] GetListDeckFactions(AbstractDeck input_deck)
        {
            string CardPool = input_deck.GetCardPool();

            if (!IsValidCardPool(input_deck))
            {
                return(new string[] { "" });
            }
            else if (!CardPool.Contains(":"))
            {
                return(new string[] { CardPool });
            }
            else
            {
                return(CardPool.Split(':'));
            }
        }
コード例 #5
0
 public static bool CardInCardPool(AbstractCard input_card, AbstractDeck input_deck)
 {
     return(IsFactionInPool(input_deck, CardIDUtilities.GetCardFaction(input_card)));
 }
コード例 #6
0
            public void PickOneCardFrom(AbstractDeck deck)
            {
                Card card = deck.PickTopCard();

                _hand.Enqueue(card);
            }