aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs
diff options
context:
space:
mode:
authorCharles Krinke2008-06-28 16:18:47 +0000
committerCharles Krinke2008-06-28 16:18:47 +0000
commit2f70baee528ae94a3456c09ebdb60e9a24d7f7d0 (patch)
tree0e92de124ea526387a4125cd5e673de4c67a4993 /OpenSim/Region/ScriptEngine/Common/LSL_Types.cs
parentMantis#1620. Applied Melanie's patch (diff)
downloadopensim-SC_OLD-2f70baee528ae94a3456c09ebdb60e9a24d7f7d0.zip
opensim-SC_OLD-2f70baee528ae94a3456c09ebdb60e9a24d7f7d0.tar.gz
opensim-SC_OLD-2f70baee528ae94a3456c09ebdb60e9a24d7f7d0.tar.bz2
opensim-SC_OLD-2f70baee528ae94a3456c09ebdb60e9a24d7f7d0.tar.xz
Mantis#1623. Thank you, Melanie for a patch that:
Fully defines the equality operators on the lsl types and plubs in the script engine side of the work begun in 0001616 (aly, this one's for you)
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/LSL_Types.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_Types.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs
index ab3cba8..bfdc686 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs
@@ -1293,6 +1293,18 @@ namespace OpenSim.Region.ScriptEngine.Common
1293 return ret; 1293 return ret;
1294 } 1294 }
1295 1295
1296 public override bool Equals(Object o)
1297 {
1298 if(!(o is LSLInteger))
1299 return false;
1300 return value == ((LSLInteger)o).value;
1301 }
1302
1303 public override int GetHashCode()
1304 {
1305 return value;
1306 }
1307
1296 static public LSLInteger operator &(LSLInteger i1, LSLInteger i2) 1308 static public LSLInteger operator &(LSLInteger i1, LSLInteger i2)
1297 { 1309 {
1298 int ret = i1.value & i2.value; 1310 int ret = i1.value & i2.value;
@@ -1438,6 +1450,19 @@ namespace OpenSim.Region.ScriptEngine.Common
1438 return String.Format("{0:0.000000}", this.value); 1450 return String.Format("{0:0.000000}", this.value);
1439 } 1451 }
1440 1452
1453 public override bool Equals(Object o)
1454 {
1455 if(!(o is LSLFloat))
1456 return false;
1457 return value == ((LSLFloat)o).value;
1458 }
1459
1460 public override int GetHashCode()
1461 {
1462 return Convert.ToInt32(value);
1463 }
1464
1465
1441 #endregion 1466 #endregion
1442 } 1467 }
1443 } 1468 }