Exemple #1
0
        void RemoveElementAndChildren(GUIElement element)
        {
            requireReSort = true;

            // Remove this element
            AllSorted.Remove(element);

            // Remove this element's children
            for (int i = 0; i < element.Children.Count; i++)
            {
                RemoveElementAndChildren(element.Children[i]);
            }
        }
Exemple #2
0
        void AddElementWithChildren(GUIElement element)
        {
            requireReSort = true;

            // Add this element
            if (!AllSorted.Contains(element))
            {
                AllSorted.Add(element);
            }

            // Add this element's children
            for (int i = 0; i < element.Children.Count; i++)
            {
                AddElementWithChildren(element.Children[i]);
            }
        }
 /// <summary>
 /// Place participants into their groups.
 /// </summary>
 public void PlaceParticipantsIntoGroups()
 {
     foreach (int index in RandomizedIndex)
     {
         AllSorted.Add(All[index]);
     }
     for (int unorderIndex = 0; unorderIndex < this.NumberOfParticipants; unorderIndex++)
     {
         if (unorderIndex < this.ParticipantsPerGroup)
         {
             this.AllStarterHosts.Add(this.AllSorted[this.RandomizedIndex[unorderIndex]]);
         }
         else if (unorderIndex < this.ParticipantsPerGroup * 2)
         {
             this.AllMaincourseHosts.Add(this.AllSorted[RandomizedIndex[unorderIndex]]);
         }
         else
         {
             this.AllDesertHosts.Add(this.AllSorted[RandomizedIndex[unorderIndex]]);
         }
     }
 }
Exemple #4
0
 void Sort()
 {
     requireReSort = false;
     AllSorted.Sort(CompareZ);
 }