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; /// /// Initializes the base object /// public BaseObject() { Control = new Controls.VisualContainer(this); Script = ""; this.Name = "New " + this.GetType().Name; } } }