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

InitializeWorld() public method

public InitializeWorld ( World world, IntSize3 size ) : void
world World
size IntSize3
return void
        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();
        }

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.DungeonWorldCreator::InitializeWorld