diff options
author | Adam Frisby | 2008-05-01 16:35:00 +0000 |
---|---|---|
committer | Adam Frisby | 2008-05-01 16:35:00 +0000 |
commit | 13526097f24b7a8ad63b1d482c44b44397fa055f (patch) | |
tree | 7a82c20ed7c63e2aea5ad3863325e37f64e1cbea /OpenSim/Region/Environment/Modules/Framework | |
parent | * Breaking all the code, breaking all the code..! (diff) | |
download | opensim-SC-13526097f24b7a8ad63b1d482c44b44397fa055f.zip opensim-SC-13526097f24b7a8ad63b1d482c44b44397fa055f.tar.gz opensim-SC-13526097f24b7a8ad63b1d482c44b44397fa055f.tar.bz2 opensim-SC-13526097f24b7a8ad63b1d482c44b44397fa055f.tar.xz |
* Spring cleaning on Region.Environment.
* Converted a large number of read-only fields to be actually, readonly.
* Reformatted code sections.
* Removed redundant code.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Framework')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Framework/Commander.cs | 22 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/Framework/CommanderTestModule.cs | 2 |
2 files changed, 12 insertions, 12 deletions
diff --git a/OpenSim/Region/Environment/Modules/Framework/Commander.cs b/OpenSim/Region/Environment/Modules/Framework/Commander.cs index 4430c10..d226c3d 100644 --- a/OpenSim/Region/Environment/Modules/Framework/Commander.cs +++ b/OpenSim/Region/Environment/Modules/Framework/Commander.cs | |||
@@ -42,11 +42,11 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
42 | public class Command : ICommand | 42 | public class Command : ICommand |
43 | { | 43 | { |
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | private List<CommandArgument> m_args = new List<CommandArgument>(); | 45 | private readonly List<CommandArgument> m_args = new List<CommandArgument>(); |
46 | 46 | ||
47 | private Action<object[]> m_command; | 47 | private readonly Action<object[]> m_command; |
48 | private string m_help; | 48 | private readonly string m_help; |
49 | private string m_name; | 49 | private readonly string m_name; |
50 | 50 | ||
51 | public Command(string name, Action<Object[]> command, string help) | 51 | public Command(string name, Action<Object[]> command, string help) |
52 | { | 52 | { |
@@ -164,9 +164,9 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
164 | /// </summary> | 164 | /// </summary> |
165 | public class CommandArgument | 165 | public class CommandArgument |
166 | { | 166 | { |
167 | private string m_help; | 167 | private readonly string m_help; |
168 | private string m_name; | 168 | private readonly string m_name; |
169 | private string m_type; | 169 | private readonly string m_type; |
170 | private Object m_val; | 170 | private Object m_val; |
171 | 171 | ||
172 | public CommandArgument(string name, string help, string type) | 172 | public CommandArgument(string name, string help, string type) |
@@ -204,8 +204,8 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
204 | public class Commander : ICommander | 204 | public class Commander : ICommander |
205 | { | 205 | { |
206 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 206 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
207 | private Dictionary<string, ICommand> m_commands = new Dictionary<string, ICommand>(); | 207 | private readonly Dictionary<string, ICommand> m_commands = new Dictionary<string, ICommand>(); |
208 | private string m_name; | 208 | private readonly string m_name; |
209 | 209 | ||
210 | public Commander(string name) | 210 | public Commander(string name) |
211 | { | 211 | { |
@@ -235,11 +235,11 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
235 | } | 235 | } |
236 | classSrc = classSrc.Remove(classSrc.Length - 1); // Delete the last comma | 236 | classSrc = classSrc.Remove(classSrc.Length - 1); // Delete the last comma |
237 | classSrc += " )\n\t{\n"; | 237 | classSrc += " )\n\t{\n"; |
238 | classSrc += "\t\tObject[] args = new Object[" + com.Arguments.Count.ToString() + "];\n"; | 238 | classSrc += "\t\tObject[] args = new Object[" + com.Arguments.Count + "];\n"; |
239 | int i = 0; | 239 | int i = 0; |
240 | foreach (KeyValuePair<string, string> arg in com.Arguments) | 240 | foreach (KeyValuePair<string, string> arg in com.Arguments) |
241 | { | 241 | { |
242 | classSrc += "\t\targs[" + i.ToString() + "] = " + Util.Md5Hash(arg.Key) + " " + ";\n"; | 242 | classSrc += "\t\targs[" + i + "] = " + Util.Md5Hash(arg.Key) + " " + ";\n"; |
243 | i++; | 243 | i++; |
244 | } | 244 | } |
245 | classSrc += "\t\tGetCommander(\"" + m_name + "\").Run(\"" + com.Name + "\", args);\n"; | 245 | classSrc += "\t\tGetCommander(\"" + m_name + "\").Run(\"" + com.Name + "\", args);\n"; |
diff --git a/OpenSim/Region/Environment/Modules/Framework/CommanderTestModule.cs b/OpenSim/Region/Environment/Modules/Framework/CommanderTestModule.cs index 7b5c981..3df9129 100644 --- a/OpenSim/Region/Environment/Modules/Framework/CommanderTestModule.cs +++ b/OpenSim/Region/Environment/Modules/Framework/CommanderTestModule.cs | |||
@@ -34,7 +34,7 @@ namespace OpenSim.Region.Environment.Modules.Framework | |||
34 | { | 34 | { |
35 | public class CommanderTestModule : IRegionModule, ICommandableModule | 35 | public class CommanderTestModule : IRegionModule, ICommandableModule |
36 | { | 36 | { |
37 | private Commander m_commander = new Commander("CommanderTest"); | 37 | private readonly Commander m_commander = new Commander("CommanderTest"); |
38 | private Scene m_scene; | 38 | private Scene m_scene; |
39 | 39 | ||
40 | #region ICommandableModule Members | 40 | #region ICommandableModule Members |