public void InitializeWorld(World world, IntSize3 size) { CreateTerrain(size); IntVector3?stairs = null; foreach (var p2 in m_terrainData.Size.Plane.Range()) { var p = new IntVector3(p2, m_terrainData.Size.Depth - 1); var td = m_terrainData.GetTileData(p.Down); if (td.ID == TileID.Stairs) { stairs = p; break; } } if (stairs.HasValue == false) { throw new Exception(); } m_env = EnvironmentObject.Create(world, m_terrainData, VisibilityMode.LivingLOS, stairs.Value); CreateMonsters(); CreateDebugMonsterAtEntry(); }
public void InitializeWorld(IntSize3 size) { CreateTerrain(size); var p = new IntVector2(m_terrainData.Width / 2, m_terrainData.Height / 2); var start = m_terrainData.GetSurfaceLocation(p); m_env = EnvironmentObject.Create(m_world, m_terrainData, VisibilityMode.AllVisible, start); }
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); }