Пример #1
0
        private static void PopulateSynergyLists()
        {
            int numberToAdd = GetRandomIndex(5, 21);

            for (int i = 0; i < numberToAdd; i++)
            {

                SynergyListNode lst =
                        new SynergyListNode(
                                WordUtils.CapitalizeFully(getRandomAdjective()) +
                                        WordUtils.CapitalizeFully(getRandomNoun())
                        );

                PopulateSynergyListItems(lst);

                mSynergyLists.Add(lst);
            }
        }
Пример #2
0
        private static void PopulateSynergyListItems(SynergyListNode lst)
        {
            //add a random number of existing items
            int numberOfExistingToAdd = GetRandomIndex(6);

            for (int i = 0; i < numberOfExistingToAdd; i++)
            {

                if (mSynergyListItems.Count > 0)
                {

                    int idx = GetRandomIndex(mSynergyListItems.Count);

                    lst.Add(mSynergyListItems[idx]);
                }
            }

            //generate a random number of new items to add to shared list
            int numberOfNewSharedToAdd = GetRandomIndex(4);

            for (int i = 0; i < numberOfNewSharedToAdd; i++)
            {

                String testText = getRandomVerb() + " " +
                        getRandomAdjective() + " " +
                        getRandomNoun();

                SynergyItemNode sli =
                        new SynergyItemNode(lst, testText);

                lst.Add(sli);
                mSynergyListItems.Add(sli);
            }

            //generate a random number of new items to keep seperate
            int numberOfNewPrivateToAdd = GetRandomIndex(4);

            for (int i = 0; i < numberOfNewPrivateToAdd; i++)
            {

                String testText = getRandomVerb() + " " +
                        getRandomAdjective() + " " +
                        getRandomNoun();

                SynergyItemNode sli =
                        new SynergyItemNode(lst, testText);

                lst.Add(sli);
            }
        }