StyleCop clean OpenRA.Game

This commit is contained in:
Matthias Mailänder
2015-01-04 11:56:13 +01:00
parent d2d715765c
commit bc3acfeee7
345 changed files with 835 additions and 833 deletions

View File

@@ -38,13 +38,13 @@ namespace OpenRA.Scripting
void InitializeBindings()
{
var commandClasses = context.ActorCommands[actor.Info].AsEnumerable();
var commandClasses = Context.ActorCommands[actor.Info].AsEnumerable();
// Destroyed actors cannot have their traits queried
if (actor.Destroyed)
commandClasses = commandClasses.Where(c => c.HasAttribute<ExposedForDestroyedActors>());
var args = new object[] { context, actor };
var args = new object[] { Context, actor };
var objects = commandClasses.Select(cg =>
{
var groupCtor = cg.GetConstructor(new Type[] { typeof(ScriptContext), typeof(Actor) });

View File

@@ -47,23 +47,23 @@ namespace OpenRA.Scripting
public abstract class ScriptActorProperties
{
protected readonly Actor self;
protected readonly ScriptContext context;
protected readonly Actor Self;
protected readonly ScriptContext Context;
public ScriptActorProperties(ScriptContext context, Actor self)
{
this.self = self;
this.context = context;
Self = self;
Context = context;
}
}
public abstract class ScriptPlayerProperties
{
protected readonly Player player;
protected readonly ScriptContext context;
protected readonly Player Player;
protected readonly ScriptContext Context;
public ScriptPlayerProperties(ScriptContext context, Player player)
{
this.player = player;
this.context = context;
Player = player;
Context = context;
}
}
@@ -123,12 +123,12 @@ namespace OpenRA.Scripting
World = world;
WorldRenderer = worldRenderer;
knownActorCommands = Game.modData.ObjectCreator
knownActorCommands = Game.ModData.ObjectCreator
.GetTypesImplementing<ScriptActorProperties>()
.ToArray();
ActorCommands = new Cache<ActorInfo, Type[]>(FilterActorCommands);
PlayerCommands = Game.modData.ObjectCreator
PlayerCommands = Game.ModData.ObjectCreator
.GetTypesImplementing<ScriptPlayerProperties>()
.ToArray();
@@ -148,7 +148,7 @@ namespace OpenRA.Scripting
registerGlobal.Call("print", fn).Dispose();
// Register global tables
var bindings = Game.modData.ObjectCreator.GetTypesImplementing<ScriptGlobal>();
var bindings = Game.ModData.ObjectCreator.GetTypesImplementing<ScriptGlobal>();
foreach (var b in bindings)
{
var ctor = b.GetConstructors(BindingFlags.Public | BindingFlags.Instance).FirstOrDefault(c =>

View File

@@ -19,12 +19,12 @@ namespace OpenRA.Scripting
protected abstract string DuplicateKeyError(string memberName);
protected abstract string MemberNotFoundError(string memberName);
protected readonly ScriptContext context;
protected readonly ScriptContext Context;
Dictionary<string, ScriptMemberWrapper> members;
public ScriptObjectWrapper(ScriptContext context)
{
this.context = context;
Context = context;
}
protected void Bind(IEnumerable<object> clrObjects)
@@ -38,7 +38,7 @@ namespace OpenRA.Scripting
if (members.ContainsKey(m.Name))
throw new LuaException(DuplicateKeyError(m.Name));
members.Add(m.Name, new ScriptMemberWrapper(context, obj, m));
members.Add(m.Name, new ScriptMemberWrapper(Context, obj, m));
}
}
}