add Deleted property to IEntity

cleanup Map.GetObjectsInRange
additional hashtable -> dictionary conversions
generic timer impl for EffectController
This commit is contained in:
Mark Sturgill 2013-11-02 10:52:08 -07:00
parent 4fccb0c3d3
commit 436e8f054a
7 changed files with 84 additions and 76 deletions

View file

@ -27,6 +27,7 @@ namespace Server
Serial Serial{ get; }
Point3D Location{ get; }
Map Map{ get; }
bool Deleted { get; }
void Delete();
void ProcessDelta();
@ -58,12 +59,14 @@ namespace Server
private Serial m_Serial;
private Point3D m_Location;
private Map m_Map;
private bool m_Deleted;
public Entity( Serial serial, Point3D loc, Map map )
{
m_Serial = serial;
m_Location = loc;
m_Map = map;
m_Deleted = false;
}
public Serial Serial {
@ -102,6 +105,12 @@ namespace Server
}
}
public bool Deleted {
get {
return m_Deleted;
}
}
public void Delete()
{
}

View file

@ -1382,19 +1382,19 @@ namespace Server
{
IEntity e = (IEntity)m_CurrentList[m_CurrentIndex];
if (e.Deleted)
continue;
if (e is Item)
{
Item item = (Item)e;
if (!item.Deleted && item.Parent == null && m_Bounds.Contains(e.Location))
return true;
}
else if (e is Mobile)
{
Mobile m = (Mobile)e;
if (!m.Deleted && m_Bounds.Contains(e.Location))
return true;
if (item.Parent != null)
continue;
}
if (m_Bounds.Contains(e.Location))
return true;
}
}
}