Dwarrowdelf.Server.Fortress.FortressWorldCreator.InitializeWorld C# (CSharp) Method

InitializeWorld() public static method

public static InitializeWorld ( World world, IntSize3 size ) : EnvironmentObject
world Dwarrowdelf.Server.World
size IntSize3
return Dwarrowdelf.Server.EnvironmentObject
		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;
		}

Usage Example

Example #1
0
        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);
        }
All Usage Examples Of Dwarrowdelf.Server.Fortress.FortressWorldCreator::InitializeWorld