Пример #1
0
 public DisplayCard(Card Card, double Scale)
 {
     this.Card = Card;
     this.Scale = Scale;
 }
Пример #2
0
 public DisplayCard(Card Card)
 {
     this.Card = Card;
     this.Scale = 1;
 }
Пример #3
0
        public static Card[] GetRandom(int Count, Random Random)
        {
            List<Card> working = new List<Card>(cards);
            Card[] retVal = new Card[Count];

            #region Pick out random cards
            for (int i = 0; i < Count; i++)
            {
                int curVal = Random.Next(working.Count);
                retVal[i] = working[curVal];
                working.RemoveAt(curVal);
            }
            #endregion

            return retVal;
        }
Пример #4
0
        public static Card[] GetRandom(int Count, Random Random, string Colour, string Group)
        {
            List<Card> working = new List<Card>(cards);
            Card[] retVal = new Card[Count];

            #region Cull based on group
            if (Group != null)
            {
                if (Group.StartsWith("!"))
                {
                    Group = Group.Substring(1);
                    for (int i = 0; i < working.Count; i++)
                    {
                        bool found = false;
                        for(int j=0;j<working[i].Groups.Length&&!found;j++)
                            if (working[i].Groups[j].ToUpper() == Group.ToUpper())
                            {
                                found = true;
                            }
                        if (found)
                        {
                            working.RemoveAt(i);
                            i--;
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < working.Count; i++)
                    {
                        bool found = false;
                        for (int j = 0; j < working[i].Groups.Length && !found; j++)
                            if (working[i].Groups[j].ToUpper() == Group.ToUpper())
                            {
                                found = true;
                            }
                        if (!found)
                        {
                            working.RemoveAt(i);
                            i--;
                        }
                    }
                }
            }
            #endregion

            #region Pick out random cards
            for (int i = 0; i < Count; i++)
            {
                int curVal = Random.Next(working.Count);
                retVal[i] = working[curVal];
                working.RemoveAt(curVal);
            }
            #endregion

            return retVal;
        }
Пример #5
0
 public PageRowCards(Card[] Cards)
 {
     this.Cards = Cards;
 }