/// <summary> /// Generates lobby and floor regions. /// </summary> private void GenerateRegions() { // Create lobby var lobbyRegionId = ChannelServer.Instance.World.DungeonManager.GetRegionId(); var lobbyRegion = new DungeonLobbyRegion(lobbyRegionId, this.Data.LobbyRegionId, this); //lobbyRegion.PlayerEnters += this.OnPlayerEntersLobby; this.Regions.Add(lobbyRegion); // Create floors for (int iFloor = 0; iFloor < this.Generator.Floors.Count; ++iFloor) { var dungeonFloor = this.Generator.Floors[iFloor]; var floorRegionId = ChannelServer.Instance.World.DungeonManager.GetRegionId(); var floorRegion = new DungeonFloorRegion(floorRegionId, this, iFloor); this.Regions.Add(floorRegion); } // Add everything to world foreach (var floor in this.Regions) { ChannelServer.Instance.World.AddRegion(floor); } // Fill this.InitRegions(); // Raise OnCreation if (this.Script != null) { this.Script.OnCreation(this); } }
/// <summary> /// Generates lobby and floor regions. /// </summary> private void GenerateRegions() { // Create lobby var lobbyRegionId = ChannelServer.Instance.World.DungeonManager.GetRegionId(); var lobbyRegion = new DungeonLobbyRegion(lobbyRegionId, this.Data.LobbyRegionId, this); lobbyRegion.PlayerEnters += this.OnPlayerEntersLobby; this.Regions.Add(lobbyRegion); // Create floors for (int iFloor = 0; iFloor < this.Generator.Floors.Count; ++iFloor) { var dungeonFloor = this.Generator.Floors[iFloor]; var floorRegionId = ChannelServer.Instance.World.DungeonManager.GetRegionId(); var floorRegion = new DungeonFloorRegion(floorRegionId, this, iFloor); this.Regions.Add(floorRegion); } // Add everything to world foreach (var floor in this.Regions) ChannelServer.Instance.World.AddRegion(floor); // Fill this.InitRegions(); // Raise OnCreation if (this.Script != null) this.Script.OnCreation(this); }