-implement LSLString -> Quaternion explicit cast

-sync Shared/LSL_Types.cs with Common/LSL_Types.cs
-get the test script in issue 1822 to compile
This commit is contained in:
Mike Mazur
2008-07-28 02:36:26 +00:00
parent a61e1ea7dc
commit d959c65b91
5 changed files with 120 additions and 0 deletions

View File

@@ -1190,6 +1190,11 @@ namespace OpenSim.Region.ScriptEngine.Shared
return new Vector3(s.m_string);
}
public static implicit operator Quaternion(LSLString s)
{
return new Quaternion(s.m_string);
}
public static implicit operator LSLFloat(LSLString s)
{
return new LSLFloat(Convert.ToDouble(s.m_string));
@@ -1291,6 +1296,11 @@ namespace OpenSim.Region.ScriptEngine.Shared
return new LSLInteger(d);
}
static public explicit operator LSLInteger(LSLFloat f)
{
return new LSLInteger(f.value);
}
static public bool operator ==(LSLInteger i1, LSLInteger i2)
{
bool ret = i1.value == i2.value;