diff options
author | Justin Clark-Casey (justincc) | 2011-07-09 01:28:27 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-07-09 01:28:27 +0100 |
commit | 6963b8b046f8a236d5a6e75a0fed81103d807c21 (patch) | |
tree | 93bf71c0eeaa942d448a6c43d66f085ddac3f18b /OpenSim/Region | |
parent | Raw int numbers (ex.LSL Constants) are displayed like "1.000000" when type ca... (diff) | |
download | opensim-SC_OLD-6963b8b046f8a236d5a6e75a0fed81103d807c21.zip opensim-SC_OLD-6963b8b046f8a236d5a6e75a0fed81103d807c21.tar.gz opensim-SC_OLD-6963b8b046f8a236d5a6e75a0fed81103d807c21.tar.bz2 opensim-SC_OLD-6963b8b046f8a236d5a6e75a0fed81103d807c21.tar.xz |
refactor: Get LSLString(LSLInteger i) constructor to now call LSLString(int i) structure to remove code duplication.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index bf66b12..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,14 +1389,14 @@ 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(int i) | 1402 | public LSLString(int i) |
@@ -1403,12 +1405,8 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
1403 | m_string = s; | 1405 | m_string = s; |
1404 | } | 1406 | } |
1405 | 1407 | ||
1406 | public LSLString(LSLInteger i) | 1408 | public LSLString(LSLInteger i) : this(i.value) {} |
1407 | { | 1409 | |
1408 | string s = String.Format("{0}", i); | ||
1409 | m_string = s; | ||
1410 | } | ||
1411 | |||
1412 | #endregion | 1410 | #endregion |
1413 | 1411 | ||
1414 | #region Operators | 1412 | #region Operators |