public static InitializeWorld ( |
||
world | ||
size | IntSize3 | |
return |
public static EnvironmentObject InitializeWorld(World world, IntSize3 size)
{
#if CACHE_TERRAIN
var terrain = CreateOrLoadTerrain(size);
#else
var terrain = CreateTerrain(size);
#endif
// XXX this is where WorldPopulator creates some buildings
var p2 = new IntVector2(terrain.Width / 2, terrain.Height / 2);
var startLoc = terrain.GetSurfaceLocation(p2);
var env = EnvironmentObject.Create(world, terrain, VisibilityMode.GlobalFOV, startLoc);
//CreateWaterTest(env);
FortressWorldPopulator.FinalizeEnv(env);
return env;
}
public DungeonGame(string gameDir, GameOptions options) : base(gameDir, options) { EnvironmentObject env; switch (options.Map) { case GameMap.Fortress: env = FortressWorldCreator.InitializeWorld(this.World, options.MapSize); break; case GameMap.Adventure: var dwc = new DungeonWorldCreator(this.World); dwc.InitializeWorld(this.World, options.MapSize); env = dwc.MainEnv; break; default: throw new Exception(); } var player = CreatePlayer(env); this.AddPlayer(player); }