コード例 #1
0
ファイル: DisplayCard.cs プロジェクト: dpendrey/KiddyApp
 public DisplayCard(Card Card, double Scale)
 {
     this.Card = Card;
     this.Scale = Scale;
 }
コード例 #2
0
ファイル: DisplayCard.cs プロジェクト: dpendrey/KiddyApp
 public DisplayCard(Card Card)
 {
     this.Card = Card;
     this.Scale = 1;
 }
コード例 #3
0
ファイル: Card.cs プロジェクト: dpendrey/KiddyApp
        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
ファイル: Card.cs プロジェクト: dpendrey/KiddyApp
        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
ファイル: Story.cs プロジェクト: dpendrey/KiddyApp
 public PageRowCards(Card[] Cards)
 {
     this.Cards = Cards;
 }