muddesigner/MudEngine/GameObjects/Environment/Realm.cs
Scionwest_cp e145d57682 MudEngine:
- Rooms can now be linked automatically via the new Zone.LinkRooms method. Room linking can no longer be done manually as the Doorways property is now read-only.
 - Door.Description has been removed. Doorway description will need to be included in Room.Description or Room.DetailedDescription properties.
 - Added DetailedDescription to make creating multi-line descriptions easier. Not supported by the Look command yet.
 - Game.IsRunning is now read-only. The Game will manage this property on its own.
 - BaseCharacter.ExecuteCommand now will always return a string. Simplifying the game loop for users as they no longer need to check what Type was returned by the command.
 - Doors now contain a DepartureRoom and a ArrivalRoom property allowing for easy access to Rooms that are linked together.
 - Fixed a bug where Game, Realms and Zones always assigned IsInitial to Realms, Zones and Rooms when added to the collections. Collection would contain multiple IsInitial objects.
 - Removed Room.InstalledDoorways property as that was used only by the old Designer
 - Removed Room.Load() as that implementation of it is obsolete.

MudGame:
 - Revised Zeroth to build it's Zone and Rooms using the new Zone.LinkRooms function.
 - Greatly revised Program.cs and the Game loop to take advantage of many of the automations provided by the Engine now.
2010-07-25 20:50:39 -07:00

76 lines
2.2 KiB
C#

//Microsoft .NET Framework
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.ComponentModel;
//MUD Engine
using MudEngine.FileSystem;
using MudEngine.GameObjects;
namespace MudEngine.GameObjects.Environment
{
public class Realm : BaseObject
{
[Category("Environment Information")]
[Description("A collection of Zones that are contained within this Realm. Players can traverse the world be traveling through Rooms that are contained within Zones. Note that it is not required to place a Zone into a Realm.")]
//[EditorAttribute(typeof(UIRealmEditor), typeof(System.Drawing.Design.UITypeEditor))]
public List<Zone> ZoneCollection { get; private set; }
/// <summary>
/// Gets or Sets if this Realm is the starting realm for the game.
/// </summary>
public bool IsInitialRealm { get; set; }
/// <summary>
/// The Initial Starting Zone for this Realm.
/// </summary>
public Zone InitialZone { get; private set; }
public Realm()
{
ZoneCollection = new List<Zone>();
}
/// <summary>
/// Returns the requested Zone if the Zone exists within this Realm.
/// </summary>
/// <param name="zoneName"></param>
/// <returns></returns>
public Zone GetZone(string name)
{
foreach (Zone zone in ZoneCollection)
{
if (zone.Name == name)
return zone;
}
return null;
}
public void AddZone(Zone zone)
{
if (zone.IsInitialZone)
{
foreach (Zone z in ZoneCollection)
{
if (z.IsInitialZone)
{
z.IsInitialZone = false;
break;
}
}
}
if (zone.IsInitialZone)
InitialZone = zone;
//TODO: Check fo duplicates
ZoneCollection.Add(zone);
}
}
}