/// <summary> /// Creates an in-memory world with a given world generator. /// </summary> public Level(IWorldGenerator generator) : this() { GeneratorName = generator.GeneratorName; generator.Seed = RandomSeed; generator.Initialize(this); WorldGenerator = generator; Spawn = WorldGenerator.SpawnPoint; }
/// <summary> /// Creates a new world for server-side use with the specified world generator. /// </summary> public World(IWorldGenerator worldGenerator) { Name = "world"; WorldGenerator = worldGenerator; Seed = DataUtility.Random.Next(); Entities = new List<Entity>(); Regions = new Dictionary<Vector3, Region>(); worldGenerator.Initialize(); }
private void Debug(IWorldGenerator generator) { Alex.IsMultiplayer = false; Alex.IsMouseVisible = false; generator.Initialize(); var debugProvider = new SPWorldProvider(Alex, generator); Alex.LoadWorld(debugProvider, debugProvider.Network); }
/// <summary> /// Creates a new world for server-side use with the specified world generator /// and the specified working directory. /// </summary> public World(IWorldGenerator worldGenerator, string directory) { Name = "world"; WorldGenerator = worldGenerator; Seed = DataUtility.Random.Next(); Entities = new List<Entity>(); Regions = new Dictionary<Vector3, Region>(); Directory = directory; if (!System.IO.Directory.Exists(directory)) System.IO.Directory.CreateDirectory(directory); worldGenerator.Initialize(); }
public Level(IWorldGenerator worldGenerator, string directory) { Difficulty = Difficulty.Normal; Name = "world"; if (!Directory.Exists(directory)) { Directory.CreateDirectory(directory); } LevelDirectory = directory; WorldGenerator = worldGenerator; WorldGenerator.Initialize(this); SpawnPoint = WorldGenerator.SpawnPoint; World = new World(this, WorldGenerator, Path.Combine(directory, "region")); SaveInterval = TimeSpan.FromSeconds(5); saveTimer = new Timer(Save, null, (int)SaveInterval.TotalMilliseconds, Timeout.Infinite); tickTimer = new Timer(Tick, null, TickLength, TickLength); }
/// <summary> /// Creates an in-memory world with a given world generator. /// </summary> public Level(IWorldGenerator generator) : this() { GeneratorName = generator.GeneratorName; generator.Seed = RandomSeed; generator.Initialize(this); WorldGenerator = generator; Spawn = WorldGenerator.SpawnPoint; }
/// <summary> /// Creates a new world for server-side use with the specified world generator and seed. /// </summary> /// <param name="worldGenerator"></param> /// <param name="seed"></param> public World(IWorldGenerator worldGenerator, long seed) : this(worldGenerator) { Seed = seed; worldGenerator.Initialize(); }
public Level(IWorldGenerator worldGenerator, string directory) { Difficulty = Difficulty.Normal; Name = "world"; if (!Directory.Exists(directory)) Directory.CreateDirectory(directory); LevelDirectory = directory; WorldGenerator = worldGenerator; WorldGenerator.Initialize(this); SpawnPoint = WorldGenerator.SpawnPoint; World = new World(this, WorldGenerator, Path.Combine(directory, "region")); SaveInterval = TimeSpan.FromSeconds(5); saveTimer = new Timer(Save, null, (int)SaveInterval.TotalMilliseconds, Timeout.Infinite); tickTimer = new Timer(Tick, null, TickLength, TickLength); }
public Level(IWorldGenerator generator) : this() { WorldGenerator = generator; generator.Initialize(this); World.WorldGenerator = WorldGenerator; }
public Level(IWorldGenerator generator) : this() { WorldGenerator = generator; generator.Initialize(this); World.WorldGenerator = WorldGenerator; }