From 67e12b95ea7b68f4904a7484d77ecfd787d16d0c Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Tue, 30 Oct 2007 09:05:31 +0000 Subject: * Optimized usings * Shortened type references * Removed redundant 'this' qualifier --- OpenSim/Region/ScriptEngine/Common/Executor.cs | 88 +++++++++++----------- OpenSim/Region/ScriptEngine/Common/IScript.cs | 6 +- .../Common/LSL_BuiltIn_Commands_Interface.cs | 15 ++-- OpenSim/Region/ScriptEngine/Common/LSL_Types.cs | 26 ++++--- .../ScriptEngine/Common/Properties/AssemblyInfo.cs | 31 ++++---- 5 files changed, 82 insertions(+), 84 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Common') diff --git a/OpenSim/Region/ScriptEngine/Common/Executor.cs b/OpenSim/Region/ScriptEngine/Common/Executor.cs index a2148ea..c656e01 100644 --- a/OpenSim/Region/ScriptEngine/Common/Executor.cs +++ b/OpenSim/Region/ScriptEngine/Common/Executor.cs @@ -28,7 +28,6 @@ using System; using System.Collections.Generic; -using System.Text; using System.Reflection; using System.Runtime.Remoting.Lifetime; @@ -53,7 +52,7 @@ namespace OpenSim.Region.ScriptEngine.Common { //Console.WriteLine("Executor: InitializeLifetimeService()"); // return null; - ILease lease = (ILease)base.InitializeLifetimeService(); + ILease lease = (ILease) base.InitializeLifetimeService(); if (lease.CurrentState == LeaseState.Initial) { @@ -75,56 +74,56 @@ namespace OpenSim.Region.ScriptEngine.Common // Instead use RuntimeTypeHandle, RuntimeFieldHandle and RunTimeHandle (IntPtr) instead! //try //{ - if (m_Running == false) - { - // Script is inactive, do not execute! - return; - } + if (m_Running == false) + { + // Script is inactive, do not execute! + return; + } - string EventName = m_Script.State() + "_event_" + FunctionName; + string EventName = m_Script.State() + "_event_" + FunctionName; - //type.InvokeMember(EventName, BindingFlags.InvokeMethod, null, m_Script, args); + //type.InvokeMember(EventName, BindingFlags.InvokeMethod, null, m_Script, args); - //Console.WriteLine("ScriptEngine Executor.ExecuteEvent: \"" + EventName + "\""); + //Console.WriteLine("ScriptEngine Executor.ExecuteEvent: \"" + EventName + "\""); - if (Events.ContainsKey(EventName) == false) + if (Events.ContainsKey(EventName) == false) + { + // Not found, create + Type type = m_Script.GetType(); + try { - // Not found, create - Type type = m_Script.GetType(); - try - { - MethodInfo mi = type.GetMethod(EventName); - Events.Add(EventName, mi); - } - catch - { - // Event name not found, cache it as not found - Events.Add(EventName, null); - } + MethodInfo mi = type.GetMethod(EventName); + Events.Add(EventName, mi); } - - // Get event - MethodInfo ev = null; - Events.TryGetValue(EventName, out ev); - - if (ev == null) // No event by that name! + catch { - //Console.WriteLine("ScriptEngine Can not find any event named: \"" + EventName + "\""); - return; + // Event name not found, cache it as not found + Events.Add(EventName, null); } + } + + // Get event + MethodInfo ev = null; + Events.TryGetValue(EventName, out ev); + + if (ev == null) // No event by that name! + { + //Console.WriteLine("ScriptEngine Can not find any event named: \"" + EventName + "\""); + return; + } - // Found - //try - //{ - // Invoke it - ev.Invoke(m_Script, args); + // Found + //try + //{ + // Invoke it + ev.Invoke(m_Script, args); - //} - //catch (Exception e) - //{ - // // TODO: Send to correct place - // Console.WriteLine("ScriptEngine Exception attempting to executing script function: " + e.ToString()); - //} + //} + //catch (Exception e) + //{ + // // TODO: Send to correct place + // Console.WriteLine("ScriptEngine Exception attempting to executing script function: " + e.ToString()); + //} //} @@ -136,8 +135,5 @@ namespace OpenSim.Region.ScriptEngine.Common { m_Running = false; } - - } - -} +} \ No newline at end of file diff --git a/OpenSim/Region/ScriptEngine/Common/IScript.cs b/OpenSim/Region/ScriptEngine/Common/IScript.cs index df0e824..08c0e9c 100644 --- a/OpenSim/Region/ScriptEngine/Common/IScript.cs +++ b/OpenSim/Region/ScriptEngine/Common/IScript.cs @@ -26,10 +26,6 @@ * */ -using System; -using System.Collections.Generic; -using System.Text; - namespace OpenSim.Region.ScriptEngine.Common { public interface IScript @@ -37,4 +33,4 @@ namespace OpenSim.Region.ScriptEngine.Common string State(); Executor Exec { get; } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs index ff5c6bf..9cba882 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs @@ -26,15 +26,12 @@ * */ /* Original code: Tedd Hansen */ -using System; using System.Collections.Generic; -using System.Text; namespace OpenSim.Region.ScriptEngine.Common { public interface LSL_BuiltIn_Commands_Interface { - string State(); double llSin(double f); @@ -404,7 +401,9 @@ namespace OpenSim.Region.ScriptEngine.Common //wiki: llSetTextureAnim(integer mode, integer face, integer sizex, integer sizey, double start, double length, double rate) void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate); //wiki: llTriggerSoundLimited(string sound, double volume, vector top_north_east, vector bottom_south_west) - void llTriggerSoundLimited(string sound, double volume, LSL_Types.Vector3 top_north_east, LSL_Types.Vector3 bottom_south_west); + void llTriggerSoundLimited(string sound, double volume, LSL_Types.Vector3 top_north_east, + LSL_Types.Vector3 bottom_south_west); + //wiki: llEjectFromLand(key pest) void llEjectFromLand(string pest); void llParseString2List(); @@ -437,7 +436,7 @@ namespace OpenSim.Region.ScriptEngine.Common //wiki: double llGetRegionFPS() double llGetRegionFPS(); //wiki: llParticleSystem(List rules - void llParticleSystem(List rules); + void llParticleSystem(List rules); //wiki: llGroundRepel(double height, integer water, double tau) void llGroundRepel(double height, int water, double tau); void llGiveInventoryList(); @@ -548,7 +547,9 @@ namespace OpenSim.Region.ScriptEngine.Common //wiki: list llParseStringKeepNulls( string src, list separators, list spacers ) List llParseStringKeepNulls(string src, List seperators, List spacers); //wiki: llRezAtRoot(string inventory, vector position, vector velocity, rotation rot, integer param) - void llRezAtRoot(string inventory, LSL_Types.Vector3 position, LSL_Types.Vector3 velocity, LSL_Types.Quaternion rot, int param); + void llRezAtRoot(string inventory, LSL_Types.Vector3 position, LSL_Types.Vector3 velocity, + LSL_Types.Quaternion rot, int param); + //wiki: integer llGetObjectPermMask(integer mask) int llGetObjectPermMask(int mask); //wiki: llSetObjectPermMask(integer mask, integer value) @@ -632,4 +633,4 @@ namespace OpenSim.Region.ScriptEngine.Common //OpenSim functions string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer); } -} +} \ No newline at end of file diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs index 7d69379..df3d752 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs @@ -41,11 +41,12 @@ namespace OpenSim.Region.ScriptEngine.Common public double Z; public Vector3(Vector3 vector) - { - X = (float)vector.X; - Y = (float)vector.Y; - Z = (float)vector.Z; - } + { + X = (float) vector.X; + Y = (float) vector.Y; + Z = (float) vector.Z; + } + public Vector3(double x, double y, double z) { X = x; @@ -53,6 +54,7 @@ namespace OpenSim.Region.ScriptEngine.Common Z = z; } } + [Serializable] public struct Quaternion { @@ -62,12 +64,13 @@ namespace OpenSim.Region.ScriptEngine.Common public double R; public Quaternion(Quaternion Quat) - { - X = (float)Quat.X; - Y = (float)Quat.Y; - Z = (float)Quat.Z; - R = (float)Quat.R; + { + X = (float) Quat.X; + Y = (float) Quat.Y; + Z = (float) Quat.Z; + R = (float) Quat.R; } + public Quaternion(double x, double y, double z, double r) { X = x; @@ -75,7 +78,6 @@ namespace OpenSim.Region.ScriptEngine.Common Z = z; R = r; } - } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/ScriptEngine/Common/Properties/AssemblyInfo.cs b/OpenSim/Region/ScriptEngine/Common/Properties/AssemblyInfo.cs index 98704d5..48cf45a 100644 --- a/OpenSim/Region/ScriptEngine/Common/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/ScriptEngine/Common/Properties/AssemblyInfo.cs @@ -1,26 +1,28 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("OpenSim.Region.ScriptEngine.Common")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OpenSim.Region.ScriptEngine.Common")] -[assembly: AssemblyCopyright("Copyright © 2007")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] + +[assembly : AssemblyTitle("OpenSim.Region.ScriptEngine.Common")] +[assembly : AssemblyDescription("")] +[assembly : AssemblyConfiguration("")] +[assembly : AssemblyCompany("")] +[assembly : AssemblyProduct("OpenSim.Region.ScriptEngine.Common")] +[assembly : AssemblyCopyright("Copyright © 2007")] +[assembly : AssemblyTrademark("")] +[assembly : AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] + +[assembly : ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("0bf07c53-ae51-487f-a907-e9b30c251602")] + +[assembly : Guid("0bf07c53-ae51-487f-a907-e9b30c251602")] // Version information for an assembly consists of the following four values: // @@ -29,5 +31,6 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] + +[assembly : AssemblyVersion("1.0.0.0")] +[assembly : AssemblyFileVersion("1.0.0.0")] \ No newline at end of file -- cgit v1.1