示例#1
0
        public Planet Create()
        {
            var isHabitable = randomGenerator.GenerateBool(probHabitable);
            var area        = randomGenerator.GenerateDouble(minArea, maxArea);

            return(new Planet(positionFactory.Create(), isHabitable, area));
        }
        public IEnumerable <BaseSpaceObject> Create(int amount)
        {
            for (var i = 0; i < amount; i++)
            {
                var genPlanet = randomGenerator.GenerateBool(probPlanet);

                if (genPlanet)
                {
                    yield return(planetFactory.Create());
                }
                else
                {
                    yield return(monsterFactory.Create());
                }
            }
        }