Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
105
Server/IEntity.cs
Normal file
105
Server/IEntity.cs
Normal file
@@ -0,0 +1,105 @@
|
||||
#region References
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace Server
|
||||
{
|
||||
public interface IEntity : IPoint3D, IComparable, IComparable<IEntity>
|
||||
{
|
||||
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<Entity>
|
||||
{
|
||||
public Serial Serial { get; private set; }
|
||||
|
||||
public Point3D Location { get; set; }
|
||||
public Map Map { get; set; }
|
||||
|
||||
public int X { get { return Location.X; } }
|
||||
public int Y { get { return Location.Y; } }
|
||||
public int Z { get { return 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)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user