diff --git a/MudEngine/FileSystem/FileManager.cs b/MudEngine/FileSystem/FileManager.cs index 501ca36..eb4ea77 100644 --- a/MudEngine/FileSystem/FileManager.cs +++ b/MudEngine/FileSystem/FileManager.cs @@ -118,7 +118,7 @@ namespace MudEngine.FileSystem String[] fileData = File.ReadAllLines(filename); Int32 line = 0; - while (line <= fileData.Length) + while (line <= fileData.Length - 1) { if (fileData[line].StartsWith(";")) continue; diff --git a/MudEngine/GameManagement/Game.cs b/MudEngine/GameManagement/Game.cs index da22a49..e6155eb 100644 --- a/MudEngine/GameManagement/Game.cs +++ b/MudEngine/GameManagement/Game.cs @@ -327,7 +327,7 @@ namespace MudEngine.GameManagement { if (PlayerCollection[i].Name == "New BaseCharacter") continue; - PlayerCollection[i].ExecuteCommand("Save"); + PlayerCollection[i].Save(this.DataPaths.Players); } //Delete the last saved version of the World. We will dump the current version onto disk. @@ -355,7 +355,10 @@ namespace MudEngine.GameManagement FileManager.WriteLine(filename, this.DataPaths.Players, "DataPathPlayers"); FileManager.WriteLine(filename, this.GameTitle, "GameTitle"); FileManager.WriteLine(filename, this.HideRoomNames.ToString(), "HideRoomNames"); - FileManager.WriteLine(filename, this.InitialRealm.Filename, "InitialRealm"); + + if (this.InitialRealm.Name != "New Realm") + FileManager.WriteLine(filename, this.InitialRealm.Filename, "InitialRealm"); + FileManager.WriteLine(filename, this.IsMultiplayer.ToString(), "IsMultiplayer"); FileManager.WriteLine(filename, this.MaximumPlayers.ToString(), "MaximumPlayers"); FileManager.WriteLine(filename, this.PreCacheObjects.ToString(), "PreCacheObjects"); diff --git a/MudEngine/GameManagement/GameWorld.cs b/MudEngine/GameManagement/GameWorld.cs index 3878468..d99a621 100644 --- a/MudEngine/GameManagement/GameWorld.cs +++ b/MudEngine/GameManagement/GameWorld.cs @@ -117,6 +117,8 @@ namespace MudEngine.GameManagement //Restore the Realm objects properties from file. r.Load(Path.Combine(_Game.DataPaths.Environment, Path.GetFileNameWithoutExtension(realm), realm)); + Boolean isFound = false; + //Loop through each of the Realm objects instanced during startup and find one matching the loaded filename for (int x = 0; x != RealmCollection.Count; x++) { @@ -124,9 +126,13 @@ namespace MudEngine.GameManagement if (RealmCollection[x].Filename == r.Filename) { RealmCollection[x] = r; + isFound = true; break; } } + + if (!isFound) + RealmCollection.Add(r); } @@ -182,7 +188,7 @@ namespace MudEngine.GameManagement { foreach (Realm r in RealmCollection) { - if (r.Filename == filename) + if (r.Filename.ToLower() == filename.ToLower()) return r; } diff --git a/MudEngine/GameObjects/Characters/BaseCharacter.cs b/MudEngine/GameObjects/Characters/BaseCharacter.cs index d07b015..6251d08 100644 --- a/MudEngine/GameObjects/Characters/BaseCharacter.cs +++ b/MudEngine/GameObjects/Characters/BaseCharacter.cs @@ -156,7 +156,7 @@ //TODO: determin which zone is the appropriate zone to assign if more than one exists. } - List rooms = zone.GetRoomByFilename(FileManager.GetData(filename, "CurrentRoom")); + List rooms = zone.GetRoom(FileManager.GetData(filename, "CurrentRoom")); if (rooms.Count == 0) { diff --git a/MudEngine/GameObjects/Environment/Door.cs b/MudEngine/GameObjects/Environment/Door.cs index 6c5102b..d1c89ec 100644 --- a/MudEngine/GameObjects/Environment/Door.cs +++ b/MudEngine/GameObjects/Environment/Door.cs @@ -93,9 +93,9 @@ namespace MudEngine.GameObjects.Environment Zone z = zlist[0]; //TODO: Load the Room via Game.World.GetRealm().GetZone(). Ensures that the Room is only loaded once in memory. - if (z.GetRoomByFilename(path[2]) != null) + if (z.GetRoom(path[2]) != null) { - List rlist = z.GetRoomByFilename(path[2]); + List rlist = z.GetRoom(path[2]); if (roomType == RoomTravelType.Arrival) ArrivalRoom = rlist[0]; diff --git a/MudEngine/GameObjects/Environment/Realm.cs b/MudEngine/GameObjects/Environment/Realm.cs index dae6347..218d0da 100644 --- a/MudEngine/GameObjects/Environment/Realm.cs +++ b/MudEngine/GameObjects/Environment/Realm.cs @@ -42,15 +42,12 @@ namespace MudEngine.GameObjects.Environment IsInitialRealm = Convert.ToBoolean(FileManager.GetData(filename, "IsInitialRealm")); - String zoneFile = FileManager.GetData(filename, "InitialZone"); - String realmPath = filename.Substring(0, filename.Length - Path.GetFileName(filename).Length); - String zonePath = Path.Combine(realmPath, "Zones", Path.GetFileNameWithoutExtension(zoneFile)); - //Load all zones foreach (String zone in FileManager.GetCollectionData(filename, "ZoneCollection")) { Zone z = new Zone(ActiveGame); - z.Load(Path.Combine(zonePath, zone)); + String path = Path.Combine(ActiveGame.DataPaths.Environment, Path.GetFileNameWithoutExtension(this.Filename), "Zones", Path.GetFileNameWithoutExtension(zone)); + z.Load(Path.Combine(path, zone)); //Check if this is the initial Zone. if (z.IsInitialZone) @@ -68,7 +65,8 @@ namespace MudEngine.GameObjects.Environment String filename = Path.Combine(path, Filename); FileManager.WriteLine(filename, this.IsInitialRealm.ToString(), "IsInitialRealm"); - FileManager.WriteLine(filename, this.InitialZone.Filename, "InitialZone"); + if (this.InitialZone.Name != "New Zone") + FileManager.WriteLine(filename, this.InitialZone.Filename, "InitialZone"); String zonePath = Path.Combine(path, "Zones"); foreach (Zone z in ZoneCollection) @@ -86,7 +84,7 @@ namespace MudEngine.GameObjects.Environment foreach (Zone zone in ZoneCollection) { - if (zone.Filename == filename) + if (zone.Filename.ToLower() == filename.ToLower()) { zones.Add(zone); } diff --git a/MudEngine/GameObjects/Environment/Room.cs b/MudEngine/GameObjects/Environment/Room.cs index e3c1cc7..3d04673 100644 --- a/MudEngine/GameObjects/Environment/Room.cs +++ b/MudEngine/GameObjects/Environment/Room.cs @@ -106,8 +106,7 @@ namespace MudEngine.GameObjects.Environment FileManager.WriteLine(filename, IsInitialRoom.ToString(), "IsInitialRoom"); FileManager.WriteLine(filename, this.IsSafe.ToString(), "IsSafe"); - FileManager.WriteLine(filename, this.Realm, "Realm"); - FileManager.WriteLine(filename, this.Zone, "Zone"); + FileManager.WriteLine(filename, this.RoomLocationWithoutExtension, "RoomLocation"); FileManager.WriteLine(filename, Doorways.Count.ToString(), "DoorwayCount"); @@ -128,8 +127,16 @@ namespace MudEngine.GameObjects.Environment this.IsInitialRoom = Convert.ToBoolean(FileManager.GetData(filename, "IsInitialRoom")); this.IsSafe = Convert.ToBoolean(FileManager.GetData(filename, "IsSafe")); - this.Realm = FileManager.GetData(filename, "Realm"); - this.Zone = FileManager.GetData(filename, "Zone"); + String[] env = FileManager.GetData(filename, "RoomLocation").Split('>'); + + if (env.Length != 3) + { + Log.Write("ERROR: Room " + filename + " does not contain a proper location path in Room.RoomLocation. Path is " + FileManager.GetData(filename, "RoomLocation")); + return; + } + + this.Realm = env[0] + ".Realm"; + this.Zone = env[1] + ".Zone"; //SetRoomToDoorNorth //SetRoomToDoorEast diff --git a/MudEngine/GameObjects/Environment/Zone.cs b/MudEngine/GameObjects/Environment/Zone.cs index c8c59af..d4940f5 100644 --- a/MudEngine/GameObjects/Environment/Zone.cs +++ b/MudEngine/GameObjects/Environment/Zone.cs @@ -99,13 +99,15 @@ namespace MudEngine.GameObjects.Environment FileManager.WriteLine(filename, this.Realm, "Realm"); FileManager.WriteLine(filename, this.StatDrain.ToString(), "StatDrain"); FileManager.WriteLine(filename, this.StatDrainAmount.ToString(), "StatDrainAmount"); - FileManager.WriteLine(filename, this.InitialRoom.Filename, "InitialRoom"); + + if (this.InitialRoom.Name != "New Room") + FileManager.WriteLine(filename, this.InitialRoom.Filename, "InitialRoom"); String roomPath = Path.Combine(path, "Rooms"); foreach (Room r in RoomCollection) { FileManager.WriteLine(filename, r.Filename, "RoomCollection"); - r.Save(roomPath); + r.Save(roomPath); } } @@ -119,28 +121,16 @@ namespace MudEngine.GameObjects.Environment this.StatDrain = Convert.ToBoolean(FileManager.GetData(filename, "StatDrain")); this.StatDrainAmount = Convert.ToInt32(FileManager.GetData(filename, "StatDrainAmount")); - //Load the InitialRoom - String roomFile = FileManager.GetData(filename, "InitialRoom"); - String realmPath = Path.Combine(ActiveGame.DataPaths.Environment, Path.GetFileNameWithoutExtension(this.Realm)); - String zonePath = Path.Combine(realmPath, "Zones", Path.GetFileNameWithoutExtension(this.Filename)); - String roomPath = Path.Combine(zonePath, "Rooms"); - //Now get the rooms in the zone foreach (String room in FileManager.GetCollectionData(filename, "RoomCollection")) { Room r = new Room(ActiveGame); - r.Load(Path.Combine(roomPath, room)); + String path = Path.Combine(ActiveGame.DataPaths.Environment, Path.GetFileNameWithoutExtension(this.Realm), "Zones", Path.GetFileNameWithoutExtension(this.Filename), "Rooms"); + r.Load(Path.Combine(path, room)); RoomCollection.Add(r); - } - //Set the initial Room. - foreach (Room r in RoomCollection) - { if (r.IsInitialRoom) - { - InitialRoom = r; - break; - } + this.InitialRoom = r; } } @@ -172,14 +162,14 @@ namespace MudEngine.GameObjects.Environment room.Realm = Realm; } - public List GetRoomByFilename(String filename) + public List GetRoom(String filename) { List rooms = new List(); foreach (Room r in RoomCollection) { - if (r.Filename == filename) + if (r.Filename.ToLower() == filename.ToLower()) { rooms.Add(r); } diff --git a/MudGame/MudGame.csproj b/MudGame/MudGame.csproj index 4e5be0a..9b61f6b 100644 --- a/MudGame/MudGame.csproj +++ b/MudGame/MudGame.csproj @@ -67,7 +67,7 @@ PreserveNewest - PreserveNewest + Always PreserveNewest diff --git a/MudGame/Scripts/CommandCreate.cs b/MudGame/Scripts/CommandCreate.cs index 336aad1..ba5ced5 100644 --- a/MudGame/Scripts/CommandCreate.cs +++ b/MudGame/Scripts/CommandCreate.cs @@ -25,6 +25,11 @@ public class CommandCreate : IGameCommand /// public List Help { get; set; } + //Private fields that are used during the creation of the environments. + private Realm realm; + private Zone zone; + private Room room; + /// /// Constructor for the class. /// @@ -35,305 +40,200 @@ public class CommandCreate : IGameCommand Help.Add("Content is created at run-time while the server/game is running and players are connected."); Help.Add("Newly created content will be available for players to use/traverse immediately after creation is completed."); Help.Add("Rooms that are created may be linked together using the LinkRoom command."); + Help.Add("You may create Realms by simply supplying a Realm name. If you wish to create a Zone, you must specify the Realm name followed by a '>' then the Zone name."); + Help.Add("Example: 'Create MyRealm>MyZone'"); + Help.Add("The same concept is applied for creating Rooms."); + Help.Add("Example: 'Create MyRealm>MyZone>MyRoom'"); + Help.Add("Creating just a single Realm is used by supplying only the Realm name."); + Help.Add("Example: 'Create MyRealm'"); } + /// + /// This will execute the command allowing Admins to generate environment objects dynamically on-the-fly. + /// + /// + /// public void Execute(String command, BaseCharacter player) { - if ((player.Role == SecurityRoles.Player) || (player.Role == SecurityRoles.NPC)) + //Check if the player has the proper security role in order to create content for the game world. + if ((player.Role != SecurityRoles.Admin) && (player.Role != SecurityRoles.GM)) { - return; //Don't let them know this even exists. - } - - //Build our create menu. - player.Send(""); - player.Send("Welcome to " + player.ActiveGame.GameTitle + " World Creation Tool."); - player.Send("What would you like to create?"); - player.Send(""); - player.Send("1: Realm"); - player.Send("2: Zone"); - player.Send("3: Room"); - player.Send("4: Exit Tool"); - player.Send("At point during creation, you may type 'Cancel' to exit with no changes saved."); - player.Send(""); - player.Send("Selection: ", false); - - Int32 selection = 0; - String input = player.ReadInput(); - - //Allows for aborting the creation tool if the user wants too. - if (input.ToLower() == "cancel") - { - player.Send("Creation aborted."); + Log.Write("Player " + player.Name + " attempted to invoke the Create command without having the correct security role assigned!"); return; } - try + //Split the supplied string up. It wil give us an array of strings with the supplied + //object names if the admin has specified environment objects for creation. + String[] env = command.ToLower().Substring("Create ".Length).Split('>'); + + //No objects specified, so the admin didn't use the command correctly. + if (env.Length == 0) { - selection = Convert.ToInt32(input); - } - catch (Exception) - { - Log.Write("Invalid selection!"); - player.Send("Invalid selection!"); - player.Send("Creation aborted."); + player.Send("Invalid use of the 'Create' command. Please try 'Help Create' for help using the command."); return; } - //Fire off what ever Method we need to, according to the users input. - switch (selection) + //Only 1 object name supplied, so we assume the admin wants a Realm created with the supplied name. + else if (env.Length == 1) { - case 1: - CreateRealm(player); - break; - case 2: - CreateZone(player); - break; - case 3: - CreateRoom(player); - break; - case 4: + //Check if the supplied name is a valid Realm name, and if the Realm can be created. + //If it's valid, the Realm is instanced and stored in our private Field 'realm' + Boolean validRealm = ValidateRealm(env[0], player); + + if (validRealm) + { + player.ActiveGame.World.AddRealm(realm); + player.Send(env[0] + " created."); + } + //Add the 'realm' Field that was instanced via ValidateRealm + else + { + Log.Write("Failed to validate realm during dynamic Creation."); + player.Send("Failed to create Realm! Please ensure a duplicate file name does not exist!"); return; + } + } + //Recieved two names, so we assume the admin wants a Zone created. + //If the Realm that is supplied for this Zone does not create, we will create it. + else if (env.Length == 2) + { + //Check if the Realm name supplied already exists. If it does, this will return false (Invalid name due to already existing) + //If it returns true, then the Realm is valid, meaning non already exists, so we will create it. + Boolean validRealm = ValidateRealm(env[0], player); + + //Add the Realm to the game world since this Zone is being created in a non-existant Realm. + if (validRealm) + { + player.ActiveGame.World.AddRealm(realm); + player.Send(env[0] + " created."); + } + Boolean validZone = ValidateZone(env[0], env[1], player); + + if (validZone) + { + realm.AddZone(zone); + player.Send(env[1] + " created."); + } + else + { + Log.Write("Failed to validate Zone during dynamic creation."); + player.Send("Failed to create Zone! Please ensure a duplicate filename does not exist!"); + return; + } + } + else if (env.Length == 3) + { + //Check if the Realm name supplied already exists. If it does, this will return false (Invalid name due to already existing) + //If it returns true, then the Realm is valid, meaning non already exists, so we will create it. + Boolean validRealm = ValidateRealm(env[0], player); + + //Add the Realm to the game world since this Zone is being created in a non-existant Realm. + if (validRealm) + { + player.ActiveGame.World.AddRealm(realm); + player.Send(env[0] + " created."); + } + + Boolean validZone = ValidateZone(env[0], env[1], player); + + if (validZone) + { + realm.AddZone(zone); + player.Send(env[1] + " created."); + } + + Boolean validRoom = ValidateRoom(env[0], env[1], env[2], player); + + if (validRoom) + { + zone.AddRoom(room); + player.Send(env[2] + " created."); + } + else + { + Log.Write("Failed to validate Room during dynamic creation."); + player.Send("Failed to create Room! Please ensure a duplicate filename does not exist!"); + return; + } } } - //Creates a Realm. - public void CreateRealm(BaseCharacter player) + /// + /// Validates if the supplied Realm filename exists in the game world or not. + /// Returns True if it does not exist; False if it does exist (As if it exists it's not a valid name to use during creation). + /// + /// + /// + /// + private Boolean ValidateRealm(String name, BaseCharacter player) { - //Instance a new Realm. - Realm realm = new Realm(player.ActiveGame); - Boolean isLegalName = false; - - while (!isLegalName) + if (player.ActiveGame.World.GetRealm(name + ".Realm") != null) { - isLegalName = true; - //Get the name of this Realm from the player. - player.Send("Realm Name: ", false); - realm.Name = player.ReadInput(); - - //Check for canceling - if (realm.Name.ToLower() == "cancel") - { - player.Send("Creation aborted."); - return; - } - - //Check if a Realm with this name already exists. - foreach (Realm r in player.ActiveGame.World.RealmCollection) - { - if (r.Name == realm.Name) - { - player.Send("Realm already exists!"); - isLegalName = false; - } - } + realm = player.ActiveGame.World.GetRealm(name + ".Realm"); + return false; } - player.ActiveGame.World.AddRealm(realm); - Log.Write(player.Name + " has created a Realm called " + realm.Name); - player.Send(realm.Name + " has been created and added to the world."); + realm = new Realm(player.ActiveGame); + realm.Name = name; + + return true; } - public void CreateZone(BaseCharacter player) + /// + /// Validates if the supplied Zone filename exists in the game world or not. + /// Returns True if it does not exist; False if it does exist (As if it exists it's not a valid name to use during creation). + /// If the Zones owning Realm does not exist, it returns false and fails. + /// + /// + /// + /// + /// + private Boolean ValidateZone(String realmName, String zoneName, BaseCharacter player) { - player.Send("Select which Realm this Zone will belong to."); - Boolean isValidRealm = false; - String input = ""; - Realm realm = new Realm(player.ActiveGame); - - while (!isValidRealm) + if (realm == null) { - isValidRealm = true;//Default to true, assume the user entered a valid name. - foreach (Realm r in player.ActiveGame.World.RealmCollection) - { - player.Send(r.Filename + " | ", false); - } - - player.Send(""); - player.Send("Selection: ", false); - - input = player.ReadInput(); - - if (input.ToLower() == "cancel") - { - player.Send("Zone creation aborted."); - return; - } - - //Ensure it's a valid name, if not then loop back and try again. - foreach (Realm r in player.ActiveGame.World.RealmCollection) - { - if (r.Filename.ToLower() == input.ToLower()) - { - isValidRealm = true; - realm = r; - break; - } - else - { - isValidRealm = false; - } - } - - if (!isValidRealm) - player.Send("That Realm does not exist! Please try again."); + player.Send("Unable to validate Zone due to invalid Realm."); + return false; } - Zone zone = new Zone(player.ActiveGame); - //realm.AddZone(zone); - - Boolean isValidZone = false; - player.Send(""); //blank line - - while (!isValidZone) + if (realm.GetZone(zoneName + ".Zone").Count != 0) { - isValidZone = true; //assume the user will enter a correct value. - player.Send("Enter a name for this Zone: ", false); - String name = player.ReadInput(); - - if (String.IsNullOrEmpty(name)) - continue; - - foreach (Zone z in realm.ZoneCollection) - { - if (z.Name == name) - { - isValidZone = false; - break; - } - } - - if (isValidZone) - { - zone.Name = name; - } + zone = realm.GetZone(zoneName + ".Zone")[0]; + return false; } - Log.Write(player.Name + " has created a Zone called " + zone.Name + " within the Realm " + realm.Name); - player.Send(zone.Name + " has been created and added to Realm " + realm.Name + "."); - realm.AddZone(zone); + zone = new Zone(player.ActiveGame); + zone.Name = zoneName; + + return true; } - public void CreateRoom(BaseCharacter player) + /// + /// Validates if the supplied Room filename exists in the game world or not. + /// Returns True if it does not exist; False if it does exist (As if it exists it's not a valid name to use during creation). + /// If the Rooms owning Zone or Realm does not exist, it returns false and fails. + /// + /// + /// + /// + /// + /// + private Boolean ValidateRoom(String realmName, String zoneName, String roomName, BaseCharacter player) { - player.Send("Select which Realm this Zone will belong to."); - Boolean isValidRealm = false; - String input = ""; - Realm realm = new Realm(player.ActiveGame); - - while (!isValidRealm) + if ((realm == null) || (zone == null)) { - isValidRealm = true;//Default to true, assume the user entered a valid name. - foreach (Realm r in player.ActiveGame.World.RealmCollection) - { - player.Send(r.Filename + " | ", false); - } - - player.Send(""); - player.Send("Selection: ", false); - - input = player.ReadInput(); - - if (input.ToLower() == "cancel") - { - player.Send("Zone creation aborted."); - return; - } - - //Ensure it's a valid name, if not then loop back and try again. - foreach (Realm r in player.ActiveGame.World.RealmCollection) - { - if (r.Filename.ToLower() == input.ToLower()) - { - isValidRealm = true; - realm = r; - break; - } - else - { - isValidRealm = false; - } - } - - if (!isValidRealm) - player.Send("That Realm does not exist! Please try again."); + player.Send("Unable to validate Room due to invalid Realm or Zone."); + return false; } - Zone zone = new Zone(player.ActiveGame); - //realm.AddZone(zone); - - Boolean isValidZone = false; - player.Send(""); //blank line - - while (!isValidZone) + if (zone.GetRoom(roomName + ".Room").Count != 0) { - isValidZone = true;//Default to true, assume the user entered a valid name. - foreach (Zone z in realm.ZoneCollection) - { - player.Send(z.Filename + " | ", false); - } - - player.Send(""); - player.Send("Selection: ", false); - - input = player.ReadInput(); - - if (input.ToLower() == "cancel") - { - player.Send("Room creation aborted."); - return; - } - - //Ensure it's a valid name, if not then loop back and try again. - foreach (Zone z in realm.ZoneCollection) - { - if (z.Filename.ToLower() == input.ToLower()) - { - isValidZone = true; - zone = z; - break; - } - else - { - isValidZone = false; - } - } - - if (!isValidZone) - player.Send("That Zone does not exist! Please try again."); + room = zone.GetRoom(roomName + ".Room")[0]; + return false; } - //Create the Room. - Room room = new Room(player.ActiveGame); + room = new Room(player.ActiveGame); + room.Name = roomName; - Boolean isValidRoom = false; - player.Send(""); //blank line - - while (!isValidRoom) - { - isValidRoom = true; //assume the user will enter a correct value. - player.Send("Enter a name for this Room: ", false); - String name = player.ReadInput(); - - if (String.IsNullOrEmpty(name)) - continue; - - foreach (Room r in zone.RoomCollection) - { - if (r.Name == name) - { - isValidRoom = false; - break; - } - } - - if (isValidRoom) - { - room.Name = name; - } - } - - - Log.Write(player.Name + " has created a Room called " + zone.Name + " within the Zone " + realm.Name + "->" + zone.Name); - player.Send(room.Name + " has been created and added to " + realm.Name + "->" + zone.Name + "."); - zone.AddRoom(room); + return true; } } \ No newline at end of file diff --git a/MudGame/Scripts/WorldCalifornia.cs b/MudGame/Scripts/WorldCalifornia.cs index e662170..018177f 100644 --- a/MudGame/Scripts/WorldCalifornia.cs +++ b/MudGame/Scripts/WorldCalifornia.cs @@ -81,7 +81,7 @@ public class WorldCalifornia //Note that assigning a new Filename must be done AFTER assigning the objects Name property a value. //Each time a objects Name property is assigned a value, it automatically generates a filename. //If a Filename is assigned prior to assigning the Name property, your previous Filename will be over-wrote. - myHallway.Filename = myHallway.Name + "1.Zone"; + myHallway.Filename = myHallway.Name + "1.Room"; //Add the Room to the previously created Zone. myZone.AddRoom(myHallway);