diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 461b473..d848b2a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | |||
@@ -1379,7 +1379,9 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
1379 | public struct LSLString | 1379 | public struct LSLString |
1380 | { | 1380 | { |
1381 | public string m_string; | 1381 | public string m_string; |
1382 | |||
1382 | #region Constructors | 1383 | #region Constructors |
1384 | |||
1383 | public LSLString(string s) | 1385 | public LSLString(string s) |
1384 | { | 1386 | { |
1385 | m_string = s; | 1387 | m_string = s; |
@@ -1387,22 +1389,24 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
1387 | 1389 | ||
1388 | public LSLString(double d) | 1390 | public LSLString(double d) |
1389 | { | 1391 | { |
1390 | string s=String.Format(Culture.FormatProvider, "{0:0.000000}", d); | 1392 | string s = String.Format(Culture.FormatProvider, "{0:0.000000}", d); |
1391 | m_string=s; | 1393 | m_string = s; |
1392 | } | 1394 | } |
1393 | 1395 | ||
1394 | public LSLString(LSLFloat f) | 1396 | public LSLString(LSLFloat f) |
1395 | { | 1397 | { |
1396 | string s = String.Format(Culture.FormatProvider, "{0:0.000000}", f.value); | 1398 | string s = String.Format(Culture.FormatProvider, "{0:0.000000}", f.value); |
1397 | m_string=s; | 1399 | m_string = s; |
1398 | } | 1400 | } |
1399 | 1401 | ||
1400 | public LSLString(LSLInteger i) | 1402 | public LSLString(int i) |
1401 | { | 1403 | { |
1402 | string s = String.Format("{0}", i); | 1404 | string s = String.Format("{0}", i); |
1403 | m_string = s; | 1405 | m_string = s; |
1404 | } | 1406 | } |
1405 | 1407 | ||
1408 | public LSLString(LSLInteger i) : this(i.value) {} | ||
1409 | |||
1406 | #endregion | 1410 | #endregion |
1407 | 1411 | ||
1408 | #region Operators | 1412 | #region Operators |
@@ -1469,6 +1473,11 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
1469 | { | 1473 | { |
1470 | return new LSLString(d); | 1474 | return new LSLString(d); |
1471 | } | 1475 | } |
1476 | |||
1477 | static public explicit operator LSLString(int i) | ||
1478 | { | ||
1479 | return new LSLString(i); | ||
1480 | } | ||
1472 | 1481 | ||
1473 | public static explicit operator LSLString(LSLFloat f) | 1482 | public static explicit operator LSLString(LSLFloat f) |
1474 | { | 1483 | { |
@@ -1742,7 +1751,17 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
1742 | public override bool Equals(Object o) | 1751 | public override bool Equals(Object o) |
1743 | { | 1752 | { |
1744 | if (!(o is LSLInteger)) | 1753 | if (!(o is LSLInteger)) |
1745 | return false; | 1754 | { |
1755 | if (o is int) | ||
1756 | { | ||
1757 | return value == (int)o; | ||
1758 | } | ||
1759 | else | ||
1760 | { | ||
1761 | return false; | ||
1762 | } | ||
1763 | } | ||
1764 | |||
1746 | return value == ((LSLInteger)o).value; | 1765 | return value == ((LSLInteger)o).value; |
1747 | } | 1766 | } |
1748 | 1767 | ||