Simplify names, remove unused usings, remove redundant casts.
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace OpenRA.Scripting
|
||||
|
||||
@@ -86,8 +86,8 @@ namespace OpenRA.Scripting
|
||||
public ScriptGlobal(ScriptContext context)
|
||||
: base(context)
|
||||
{
|
||||
// The 'this.' resolves the actual (subclass) type
|
||||
var type = this.GetType();
|
||||
// GetType resolves the actual (subclass) type
|
||||
var type = GetType();
|
||||
var names = type.GetCustomAttributes<ScriptGlobalAttribute>(true);
|
||||
if (names.Length != 1)
|
||||
throw new InvalidOperationException("[ScriptGlobal] attribute not found for global table '{0}'".F(type));
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Eluant;
|
||||
|
||||
namespace OpenRA.Scripting
|
||||
@@ -145,16 +144,16 @@ namespace OpenRA.Scripting
|
||||
return LuaNil.Instance;
|
||||
|
||||
if (obj is double)
|
||||
return (LuaValue)(double)obj;
|
||||
return (double)obj;
|
||||
|
||||
if (obj is int)
|
||||
return (LuaValue)(int)obj;
|
||||
return (int)obj;
|
||||
|
||||
if (obj is bool)
|
||||
return (LuaValue)(bool)obj;
|
||||
return (bool)obj;
|
||||
|
||||
if (obj is string)
|
||||
return (LuaValue)(string)obj;
|
||||
return (string)obj;
|
||||
|
||||
if (obj is IScriptBindable)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user