public Scene(int seed, XMLModel.WorldSettings settings, XMLModel.DecorationCollection decorationCollection, BiomeCollection biomeCollection) { Seed = seed; Settings = settings; DecorationSettings = decorationCollection; BiomeCollection = biomeCollection; }
public DecorationManager(XMLModel.DecorationCollection collection, AtlasModelLoader modelLoader, GraphicsDevice device) { data = collection; nameMeshMap = new Dictionary <string, Mesh>(); foreach (var decoration in data.Decorations) { nameMeshMap.Add(decoration.Name, modelLoader.LoadModel(decoration.Model.Name, decoration.Model.Texture, decoration.Model.ColorTexture).Mesh); } }
public void GenerateWorld(int seed, XMLModel.DecorationCollection decorationSettings, XMLModel.WorldSettings worldSettings, World.BiomeCollection biomeCollection, XMLModel.Civilization[] civSettings, int civs, int radius, int ticks) { var stopwatch = new Stopwatch(); stopwatch.Start(); // Generate world Debug.WriteLine("Generating world for seed " + seed); Scene = new Scene(seed, worldSettings, decorationSettings, biomeCollection); var random = new Random(seed); var randomCivs = civSettings.OrderBy(x => random.Next()).ToArray(); var generator = new WorldGenerator(Scene, randomCivs); generator.GenerateWorld(radius); generator.GenerateCivs(civs); Simulator = new Simulator(Scene, ticks); stopwatch.Stop(); Debug.WriteLine("Generated world in " + stopwatch.ElapsedMilliseconds + " ms"); // Let the scene renderer generate the new meshes SceneRenderer.OnNewWorldGenerated(Scene, seed); UI.GameUI = new GameUI(this); }