This commit is contained in:
Scionwest_cp 2009-12-08 10:34:20 -08:00
parent dbe4a45738
commit c7f5a9b2a7
24 changed files with 566 additions and 1315 deletions

View file

@ -7,7 +7,7 @@ using System.Windows.Forms;
using System.Xml.Serialization;
using MudDesigner.MudEngine.Interfaces;
namespace MudDesigner.MudEngine.Objects
namespace MudDesigner.MudEngine.GameObjects
{
public class BaseObject : IGameObject
{
@ -15,8 +15,15 @@ namespace MudDesigner.MudEngine.Objects
[RefreshProperties(RefreshProperties.All)] //Required to refresh Filename property in the editors propertygrid
public string Name
{
get;
set;
get
{
return this._Name;
}
set
{
this._Name = value;
this.Filename = value + ".realm";
}
}
[Category("Object Setup")]
@ -29,20 +36,27 @@ namespace MudDesigner.MudEngine.Objects
[Browsable(false)]
public string Script { get; set; }
[ReadOnly(true)]
[Category("Object Setup")]
[DefaultValue("New Realm.realm")]
public string Filename
{
//Returns the name of the object + the objects Type as it's extension.
//Filenames are generated by the class itself, users can not assign it.
get
{
string fileExtension = this.GetType().Name.ToLower();
return this._Filename;
}
set
{
if (!value.EndsWith(".realm"))
value += ".realm";
return this.Name + "." + fileExtension;
this._Filename = value;
}
}
private string _Filename = "New Realm.realm";
private string _Name = "New Realm";
/// <summary>
/// Initializes the base object
/// </summary>