示例#1
0
        public StarSystem CreateSystem(Game game, string name, int seed = -1)
        {
            // create new RNG with Seed.
            if (seed == -1)
            {
                seed = GalaxyGen.SeedRNG.Next();
            }

            StarSystem newSystem = new StarSystem(game, name, seed);

            int           numStars = newSystem.RNG.Next(1, 5);
            List <Entity> stars    = _starFactory.CreateStarsForSystem(newSystem, numStars, game.CurrentDateTime);

            foreach (Entity star in stars)
            {
                _systemBodyFactory.GenerateSystemBodiesForStar(game.StaticData, newSystem, star, game.CurrentDateTime);
            }


            // Generate Jump Points
            JPSurveyFactory.GenerateJPSurveyPoints(newSystem);
            JPFactory.GenerateJumpPoints(this, newSystem);

            //add this system to the GameMaster's Known Systems list.
            game.GameMasterFaction.GetDataBlob <FactionInfoDB>().KnownSystems.Add(newSystem.Guid);

            return(newSystem);
        }
示例#2
0
        public StarSystem CreateSystem(Game game, string name, int seed)
        {
            StarSystem newSystem = new StarSystem(game, name, seed);

            int           numStars = StaticRefLib.GameSettings.StarChances.Select(newSystem.RNG.NextDouble());
            List <Entity> stars    = _starFactory.CreateStarsForSystem(newSystem, numStars, StaticRefLib.CurrentDateTime);

            foreach (Entity star in stars)
            {
                _systemBodyFactory.GenerateSystemBodiesForStar(game.StaticData, newSystem, star, StaticRefLib.CurrentDateTime);
            }


            // Generate Jump Points
            JPSurveyFactory.GenerateJPSurveyPoints(newSystem);
            JPFactory.GenerateJumpPoints(this, newSystem);

            //add this system to the GameMaster's Known Systems list.
            game.GameMasterFaction.GetDataBlob <FactionInfoDB>().KnownSystems.Add(newSystem.Guid);
            OrbitProcessor.UpdateSystemOrbits(newSystem, StaticRefLib.CurrentDateTime); //sets the positions of all the entites.
            return(newSystem);
        }