* Spring cleaning.

* Added new generic "Location" class to handle 2D integer locations. Going to use it to replace all RegionHandle and X,Y coordinate references throughout the entire project. You have been warned.
This commit is contained in:
Adam Frisby
2008-04-29 14:04:55 +00:00
parent 9907c0fd10
commit 375163a6fe
64 changed files with 1283 additions and 1475 deletions

View File

@@ -31,13 +31,17 @@ using libsecondlife;
namespace OpenSim.Framework
{
[Serializable]
public class OSUUID: IComparable
public class OSUUID : IComparable
{
public static readonly OSUUID Zero = new OSUUID();
public Guid UUID;
public OSUUID() {}
public OSUUID()
{
}
/* Constructors */
public OSUUID(string s)
{
if (s == null)
@@ -61,6 +65,21 @@ namespace OpenSim.Framework
UUID = new Guid(0, 0, 0, BitConverter.GetBytes(u));
}
#region IComparable Members
public int CompareTo(object obj)
{
if (obj is OSUUID)
{
OSUUID ID = (OSUUID) obj;
return UUID.CompareTo(ID.UUID);
}
throw new ArgumentException("object is not a OSUUID");
}
#endregion
// out conversion
public override string ToString()
{
@@ -81,28 +100,15 @@ namespace OpenSim.Framework
public override bool Equals(object o)
{
if (!(o is LLUUID)) return false;
OSUUID uuid = (OSUUID)o;
OSUUID uuid = (OSUUID) o;
return UUID == uuid.UUID;
}
public int CompareTo(object obj)
{
if (obj is OSUUID)
{
OSUUID ID = (OSUUID)obj;
return this.UUID.CompareTo(ID.UUID);
}
throw new ArgumentException("object is not a OSUUID");
}
// Static methods
public static OSUUID Random()
{
return new OSUUID(Guid.NewGuid());
}
public static readonly OSUUID Zero = new OSUUID();
}
}
}