This commit is contained in:
Kamron Batman 2020-04-10 14:41:39 -07:00 committed by GitHub
parent 4f75cd9251
commit 5b5bfeb4b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 1696 additions and 728 deletions

View file

@ -32,6 +32,12 @@ namespace Server
void Delete();
void ProcessDelta();
bool InRange(Point2D p, int range);
bool InRange(Point3D p, int range);
bool InRange(IPoint2D p, int range);
}
public class Entity : IEntity, IComparable<Entity>
@ -75,5 +81,23 @@ namespace Server
public void ProcessDelta()
{
}
public bool InRange(Point2D p, int range) =>
p.m_X >= Location.m_X - range
&& p.m_X <= Location.m_X + range
&& p.m_Y >= Location.m_Y - range
&& p.m_Y <= Location.m_Y + range;
public bool InRange(Point3D p, int range) =>
p.m_X >= Location.m_X - range
&& p.m_X <= Location.m_X + range
&& p.m_Y >= Location.m_Y - range
&& p.m_Y <= Location.m_Y + range;
public bool InRange(IPoint2D p, int range) =>
p.X >= Location.m_X - range
&& p.X <= Location.m_X + range
&& p.Y >= Location.m_Y - range
&& p.Y <= Location.m_Y + range;
}
}