* Sanity check for ObjectAdd

* Renamed and attempted to fix the Say/Shout functions

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@64 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
John Hurliman
2006-07-18 02:54:13 +00:00
parent a9352ceed6
commit 53a2cfdfd8
3 changed files with 86 additions and 9 deletions

View File

@@ -393,6 +393,82 @@ namespace libsecondlife
{
return X.ToString() + " " + Y.ToString() + " " + Z.ToString();
}
public override int GetHashCode()
{
int x = (int)X;
int y = (int)Y;
int z = (int)Z;
return (x ^ y ^ z);
}
public override bool Equals(object o)
{
if (!(o is LLVector3))
{
return false;
}
LLVector3 vector = (LLVector3)o;
if (X == vector.X && Y == vector.Y && Z == vector.Z)
{
return true;
}
else
{
return false;
}
}
public static bool operator==(LLVector3 lhs, LLVector3 rhs)
{
try
{
if (lhs.X == rhs.X && lhs.Y == rhs.Y && lhs.Z == rhs.Z)
{
return true;
}
else
{
return false;
}
}
catch (NullReferenceException)
{
float test;
bool lhsnull = false;
bool rhsnull = false;
try
{
test = lhs.X;
}
catch (NullReferenceException)
{
lhsnull = true;
}
try
{
test = rhs.X;
}
catch (NullReferenceException)
{
rhsnull = true;
}
return (lhsnull == rhsnull);
}
return false;
}
public static bool operator!=(LLVector3 lhs, LLVector3 rhs)
{
return !(lhs == rhs);
}
}
public class LLVector3d