fix: Cleanup IPoint3D calls (#704)
This commit is contained in:
parent
788b04b958
commit
3293ffcf06
33 changed files with 158 additions and 264 deletions
|
|
@ -21,12 +21,6 @@ namespace Server
|
|||
private Point2D m_Start;
|
||||
private Point2D m_End;
|
||||
|
||||
public Rectangle2D(IPoint2D start, IPoint2D end)
|
||||
{
|
||||
m_Start = new Point2D(start);
|
||||
m_End = new Point2D(end);
|
||||
}
|
||||
|
||||
public Rectangle2D(Point2D start, Point2D end)
|
||||
{
|
||||
m_Start = start;
|
||||
|
|
@ -141,7 +135,8 @@ namespace Server
|
|||
public readonly bool Contains(Point2D p) =>
|
||||
m_Start.m_X <= p.m_X && m_Start.m_Y <= p.m_Y && m_End.m_X > p.m_X && m_End.m_Y > p.m_Y;
|
||||
|
||||
public readonly bool Contains(IPoint2D p) => m_Start <= p && m_End > p;
|
||||
public readonly bool Contains(int x, int y) =>
|
||||
m_Start.m_X <= x && m_Start.m_Y <= y && m_End.m_X > x && m_End.m_Y > y;
|
||||
|
||||
public override string ToString() => $"({X}, {Y})+({Width}, {Height})";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,6 +118,18 @@ namespace Server
|
|||
&& p.m_Z >= m_Start.m_Z
|
||||
&& p.m_Z < m_End.m_Z;
|
||||
|
||||
public bool Contains(Point2D p) =>
|
||||
p.m_X >= m_Start.m_X
|
||||
&& p.m_X < m_End.m_X
|
||||
&& p.m_Y >= m_Start.m_Y
|
||||
&& p.m_Y < m_End.m_Y;
|
||||
|
||||
public bool Contains(IPoint2D p) =>
|
||||
p.X >= m_Start.m_X
|
||||
&& p.X < m_End.m_X
|
||||
&& p.Y >= m_Start.m_Y
|
||||
&& p.Y < m_End.m_Y;
|
||||
|
||||
public bool Contains(IPoint3D p) =>
|
||||
p.X >= m_Start.m_X
|
||||
&& p.X < m_End.m_X
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ namespace Server
|
|||
{
|
||||
}
|
||||
|
||||
public WorldLocation(IPoint2D p, Map map) : this(p.X, p.Y, 0, map)
|
||||
public WorldLocation(Point2D p, Map map) : this(p.X, p.Y, 0, map)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ namespace Server
|
|||
{
|
||||
}
|
||||
|
||||
public WorldLocation(IPoint3D p, Map map) : this(p.X, p.Y, p.Z, map)
|
||||
public WorldLocation(Point3D p, Map map) : this(p.X, p.Y, p.Z, map)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue