muddesigner/MUDEngine/Objects/BaseObject.cs
Scionwest_cp 24b5c3f687 Visual Designer:
- Deleted from Solution.

Mud Designer:
 - Now checks for arguments, allowing the other editors to launch the Mud Designer with another editor supplied as an argument, allowing one editor to launch another one without needing to copy-paste a bunch of code.

MUD Engine:
 - BaseObject now sets default values for Script and Name so it's child classes won't need to.
 - Realm and Room no longer set Name and Script property default values.

Realm Explorer:
 - Now validates Script code.
 - Changed from using Managed Scripting Serialization to MUDEngine filesystem layer for saving/loading.
 - Added support for launching the Zone Builder from within the Realm Explorer.

Room Designer:
 - Changed from using Managed Scripting Serialization code, to MUD Engine Filesystem layer for saving/loading.

Zone Builder:
 - Initial UI Designs
 - Launches Room Designer for editing of rooms.
2009-11-28 00:30:40 -08:00

87 lines
2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Windows.Forms;
using System.Xml.Serialization;
using MUDEngine.Controls;
namespace MUDEngine.Objects
{
public class BaseObject
{
public virtual void OnEnter()
{
}
public virtual void OnExit()
{
}
public virtual void OnCreate()
{
}
public virtual void OnDestroy()
{
}
[Category("Object Setup")]
[RefreshProperties(RefreshProperties.All)] //Required to refresh Filename property in the editors propertygrid
public string Name
{
get;
set;
}
[Category("Object Setup")]
public string Description
{
get;
set;
}
[Browsable(false)]
public string Script { get; set; }
[ReadOnly(true)]
[Category("Object Setup")]
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.Name + "." + fileExtension;
}
}
[Browsable(false)]
[XmlIgnore()]
public Controls.VisualContainer Control
{
get
{
return this._Control;
}
internal set
{
this._Control = value;
}
}
private Controls.VisualContainer _Control;
/// <summary>
/// Initializes the base object
/// </summary>
public BaseObject()
{
Control = new Controls.VisualContainer(this);
Script = "";
this.Name = "New " + this.GetType().Name;
}
}
}