Exemple #1
0
        public static MegaCorp GenerateMegaCorp(int depth = 0, int width = 0)
        {
            int ratio = depth;
            int size  = 1;

            MegaCorp      megaCorp = new MegaCorp();
            ISet <FatCat> parents  = new HashSet <FatCat>();

            parents.Add(null);

            while (depth > 0)
            {
                if (depth > 1)
                {
                    parents.UnionWith(CapitalistGenerator.GenerateFatCats(size, parents));
                }
                else
                {
                    foreach (ICapitalist capitalist in CapitalistGenerator.GenerateCapitalists(size, parents))
                    {
                        megaCorp.Add(capitalist);
                    }
                }
                size *= ratio;
                depth--;
            }
            return(megaCorp);
        }
        public static IEnumerable <object[]> GenerateMegaCorpAndCapitalists()
        {
            List <object[]> list = new List <object[]>
            {
                new object[] { MegaCorpGenerator.GenerateMegaCorp(), CapitalistGenerator.GenerateCapitalists(GenerateSemiRandomSize()) }
            };

            return(list);
        }