Cleanup/Housekeeping (#242)

This commit is contained in:
Kamron Batman 2020-09-12 15:31:21 -07:00 committed by GitHub
parent 90ede0659f
commit 741e8d8300
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
228 changed files with 6292 additions and 2690 deletions

View file

@ -1,6 +1,6 @@
/*************************************************************************
* ModernUO *
* Copyright (C) 2019-2020 - ModernUO Development Team *
* Copyright 2019-2020 - ModernUO Development Team *
* Email: hi@modernuo.com *
* File: Point2D.cs *
* *
@ -104,14 +104,22 @@ namespace Server
public int CompareTo(Point2D other)
{
var xComparison = m_X.CompareTo(other.m_X);
if (xComparison != 0) return xComparison;
if (xComparison != 0)
{
return xComparison;
}
return m_Y.CompareTo(other.m_Y);
}
public int CompareTo(IPoint2D other)
{
var xComparison = m_X.CompareTo(other.X);
if (xComparison != 0) return xComparison;
if (xComparison != 0)
{
return xComparison;
}
return m_Y.CompareTo(other.Y);
}
}

View file

@ -1,6 +1,6 @@
/*************************************************************************
* ModernUO *
* Copyright (C) 2019-2020 - ModernUO Development Team *
* Copyright 2019-2020 - ModernUO Development Team *
* Email: hi@modernuo.com *
* File: Point3D.cs *
* *
@ -128,18 +128,34 @@ namespace Server
public int CompareTo(Point3D other)
{
var xComparison = m_X.CompareTo(other.m_X);
if (xComparison != 0) return xComparison;
if (xComparison != 0)
{
return xComparison;
}
var yComparison = m_Y.CompareTo(other.m_Y);
if (yComparison != 0) return yComparison;
if (yComparison != 0)
{
return yComparison;
}
return m_Z.CompareTo(other.m_Z);
}
public int CompareTo(IPoint3D other)
{
var xComparison = m_X.CompareTo(other.X);
if (xComparison != 0) return xComparison;
if (xComparison != 0)
{
return xComparison;
}
var yComparison = m_Y.CompareTo(other.Y);
if (yComparison != 0) return yComparison;
if (yComparison != 0)
{
return yComparison;
}
return m_Z.CompareTo(other.Z);
}
}

View file

@ -1,23 +1,3 @@
/***************************************************************************
* Point3DList.cs
* -------------------
* begin : May 1, 2002
* copyright : (C) The RunUO Software Team
* email : info@runuo.com
*
* $Id$
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
using System;
namespace Server
@ -52,7 +32,9 @@ namespace Server
m_List = new Point3D[old.Length * 2];
for (var i = 0; i < old.Length; ++i)
{
m_List[i] = old[i];
}
}
m_List[Count].m_X = x;
@ -69,7 +51,9 @@ namespace Server
m_List = new Point3D[old.Length * 2];
for (var i = 0; i < old.Length; ++i)
{
m_List[i] = old[i];
}
}
m_List[Count].m_X = p.m_X;
@ -81,12 +65,16 @@ namespace Server
public Point3D[] ToArray()
{
if (Count == 0)
{
return m_EmptyList;
}
var list = new Point3D[Count];
for (var i = 0; i < Count; ++i)
{
list[i] = m_List[i];
}
Count = 0;

View file

@ -1,6 +1,6 @@
/*************************************************************************
* ModernUO *
* Copyright (C) 2019-2020 - ModernUO Development Team *
* Copyright 2019-2020 - ModernUO Development Team *
* Email: hi@modernuo.com *
* File: Rectangle2D.cs *
* *
@ -111,16 +111,24 @@ namespace Server
public void MakeHold(Rectangle2D r)
{
if (r.m_Start.m_X < m_Start.m_X)
{
m_Start.m_X = r.m_Start.m_X;
}
if (r.m_Start.m_Y < m_Start.m_Y)
{
m_Start.m_Y = r.m_Start.m_Y;
}
if (r.m_End.m_X > m_End.m_X)
{
m_End.m_X = r.m_End.m_X;
}
if (r.m_End.m_Y > m_End.m_Y)
{
m_End.m_Y = r.m_End.m_Y;
}
}
public bool Contains(Point3D p) =>

View file

@ -1,6 +1,6 @@
/*************************************************************************
* ModernUO *
* Copyright (C) 2019-2020 - ModernUO Development Team *
* Copyright 2019-2020 - ModernUO Development Team *
* Email: hi@modernuo.com *
* File: Rectangle3D.cs *
* *
@ -81,22 +81,34 @@ namespace Server
public void MakeHold(Rectangle3D r)
{
if (r.m_Start.m_X < m_Start.m_X)
{
m_Start.m_X = r.m_Start.m_X;
}
if (r.m_Start.m_Y < m_Start.m_Y)
{
m_Start.m_Y = r.m_Start.m_Y;
}
if (r.m_Start.m_Z < m_Start.m_Z)
{
m_Start.m_Z = r.m_Start.m_Z;
}
if (r.m_End.m_X > m_End.m_X)
{
m_End.m_X = r.m_End.m_X;
}
if (r.m_End.m_Y > m_End.m_Y)
{
m_End.m_Y = r.m_End.m_Y;
}
if (r.m_End.m_Z < m_End.m_Z)
{
m_End.m_Z = r.m_End.m_Z;
}
}
public bool Contains(Point3D p) =>

View file

@ -1,6 +1,6 @@
/*************************************************************************
* ModernUO *
* Copyright (C) 2019-2020 - ModernUO Development Team *
* Copyright 2019-2020 - ModernUO Development Team *
* Email: hi@modernuo.com *
* File: WorldLocation.cs *
* *
@ -104,7 +104,11 @@ namespace Server
public int CompareTo(WorldLocation other)
{
var locComparison = m_Loc.CompareTo(other.m_Loc);
if (locComparison != 0) return locComparison;
if (locComparison != 0)
{
return locComparison;
}
return Comparer<Map>.Default.Compare(m_Map, other.m_Map);
}