fix: Cleanup IPoint3D calls (#704)

This commit is contained in:
Kamron Batman 2021-08-19 09:11:48 -07:00 committed by GitHub
parent 788b04b958
commit 3293ffcf06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 158 additions and 264 deletions

View file

@ -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})";
}