Zone Builder now creates Zones within different Realms, save and loads them. You can have two Realms, each containing a Zone with the exact same name with the new folder setup.

This commit is contained in:
Scionwest_cp 2009-12-08 11:53:38 -08:00
parent 41047da6d1
commit dfbc92c5d0
9 changed files with 370 additions and 108 deletions

View file

@ -22,7 +22,7 @@ namespace MudDesigner.MudEngine.GameObjects
set
{
this._Name = value;
this.Filename = value + ".realm";
this.Filename = value + "." + this.GetType().Name.ToLower();
}
}
@ -37,7 +37,6 @@ namespace MudDesigner.MudEngine.GameObjects
public string Script { get; set; }
[Category("Object Setup")]
[DefaultValue("New Realm.realm")]
public string Filename
{
//Returns the name of the object + the objects Type as it's extension.
@ -48,21 +47,60 @@ namespace MudDesigner.MudEngine.GameObjects
}
set
{
if (!value.EndsWith(".realm"))
value += ".realm";
string extension = "." + this.GetType().Name.ToLower();
if (!value.EndsWith(extension))
value += extension;
this._Filename = value;
}
}
private string _Filename = "New Realm.realm";
private string _Name = "New Realm";
[Category("Senses")]
[DefaultValue("You don't smell anything unsual.")]
public string Smell
{
get;
set;
}
[Category("Senses")]
[DefaultValue("You hear nothing of interest.")]
public string Listen
{
get;
set;
}
[Category("Senses")]
[DefaultValue("You feel nothing.")]
public string Feel
{
get;
set;
}
[Category("Environment Information")]
[DefaultValue(false)]
public bool IsSafe
{
get;
set;
}
private string _Filename = "";
private string _Name = "";
/// <summary>
/// Initializes the base object
/// </summary>
public BaseObject()
{
Script = "";
_Name = "New " + this.GetType().Name;
_Filename = _Name + "." + this.GetType().Name.ToLower();
this.Feel = "You feel nothing.";
this.Listen = "You hear nothing of interest.";
this.Smell = "You don't smell anything unsual.";
this.Name = DefaultName();
SetupScript();
}

View file

@ -9,54 +9,6 @@ namespace MudDesigner.MudEngine.GameObjects.Environment
{
public class Room : BaseObject
{
[Category("Room Senses")]
[DefaultValue("You don't smell anything unsual.")]
public string Smell
{
get;
set;
}
[Category("Room Senses")]
[DefaultValue("You hear nothing of interest.")]
public string Listen
{
get;
set;
}
[Category("Room Senses")]
[DefaultValue("You feel nothing.")]
public string Feel
{
get;
set;
}
[Category("Room Information")]
[DefaultValue(false)]
public bool StatDrain
{
get;
set;
}
[Category("Room Information")]
[DefaultValue(0)]
public int StatDrainAmount
{
get;
set;
}
[Category("Room Information")]
[DefaultValue(false)]
public bool IsSafeRoom
{
get;
set;
}
[Category("Room Information")]
[ReadOnly(true)]
public string DoorList
@ -93,10 +45,6 @@ namespace MudDesigner.MudEngine.GameObjects.Environment
public Room()
{
InstalledDoors = new List<Door>();
this.Feel = "You feel nothing.";
this.Listen = "You hear nothing of interest.";
this.Smell = "You don't smell anything unsual.";
this.StatDrainAmount = 0;
}
}
}

View file

@ -2,20 +2,39 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
namespace MudDesigner.MudEngine.GameObjects.Environment
{
public class Zone : BaseObject
{
[System.ComponentModel.Browsable(false)]
public string Realm
[Category("Environment Information")]
[DefaultValue(0)]
public int StatDrainAmount
{
get;
set;
}
[System.ComponentModel.Browsable(false)]
public List<Room> Rooms { get; set; }
[Category("Environment Information")]
[DefaultValue(false)]
public bool StatDrain
{
get;
set;
}
[ReadOnly(true)]
[Category("Environment Information")]
public string Realm
{
get;
set;
}
internal List<Room> Rooms { get; set; }
public Zone()
{