#region References using System; #endregion namespace Server { public interface IEntity : IPoint3D, IComparable, IComparable { Serial Serial { get; } Point3D Location { get; set; } Map Map { get; set; } bool NoMoveHS { get; set; } Direction Direction { get; set; } string Name { get; set; } int Hue { get; set; } bool Deleted { get; } void Delete(); void ProcessDelta(); void InvalidateProperties(); void OnStatsQuery(Mobile m); } public class Entity : IEntity, IComparable { public Serial Serial { get; private set; } public Point3D Location { get; set; } public Map Map { get; set; } public int X => Location.X; public int Y => Location.Y; public int Z => Location.Z; public bool Deleted { get; private set; } public bool NoMoveHS { get; set; } Direction IEntity.Direction { get; set; } string IEntity.Name { get; set; } int IEntity.Hue { get; set; } public Entity(Serial serial, Point3D loc, Map map) { Serial = serial; Location = loc; Map = map; } public int CompareTo(IEntity other) { if (other == null) { return -1; } return Serial.CompareTo(other.Serial); } public int CompareTo(Entity other) { return CompareTo((IEntity)other); } public int CompareTo(object other) { if (other == null || other is IEntity) { return CompareTo((IEntity)other); } throw new ArgumentException(); } public void Delete() { if (Deleted) { return; } Deleted = true; Location = Point3D.Zero; Map = null; } void IEntity.ProcessDelta() { } void IEntity.InvalidateProperties() { } void IEntity.OnStatsQuery(Mobile m) { } } }