* Introduces missing casts for float, integer, vector, quaterion and string to list
* Thanks idb
0.6.0-stable
Justin Clarke Casey 2008-10-29 20:09:02 +00:00
parent 8367353ea3
commit 7fdd6b74e3
1 changed files with 25 additions and 0 deletions

View File

@ -102,6 +102,11 @@ namespace OpenSim.Region.ScriptEngine.Shared
return new Vector3(s);
}
public static explicit operator list(Vector3 vec)
{
return new list(new object[] { vec });
}
public static bool operator ==(Vector3 lhs, Vector3 rhs)
{
return (lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z);
@ -351,6 +356,11 @@ namespace OpenSim.Region.ScriptEngine.Shared
return new Quaternion(s);
}
public static explicit operator list(Quaternion r)
{
return new list(new object[] { r });
}
public static bool operator ==(Quaternion lhs, Quaternion rhs)
{
// Return true if the fields match:
@ -1394,6 +1404,11 @@ namespace OpenSim.Region.ScriptEngine.Shared
return new LSLFloat(Convert.ToDouble(s.m_string));
}
public static explicit operator list(LSLString s)
{
return new list(new object[]{s});
}
#endregion
#region Overriders
@ -1488,6 +1503,11 @@ namespace OpenSim.Region.ScriptEngine.Shared
return new LSLString(i.ToString());
}
public static explicit operator list(LSLInteger i)
{
return new list(new object[] { i });
}
static public implicit operator Boolean(LSLInteger i)
{
if (i.value == 0)
@ -1748,6 +1768,11 @@ namespace OpenSim.Region.ScriptEngine.Shared
return new LSLFloat(double.Parse(v));
}
public static explicit operator list(LSLFloat f)
{
return new list(new object[] { f });
}
static public implicit operator LSLFloat(double d)
{
return new LSLFloat(d);