Exemplo n.º 1
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);
        }