StyleCop
This commit is contained in:
@@ -64,7 +64,7 @@ namespace OpenRA.Editor
|
||||
{
|
||||
g.DrawImage(brushTemplate.Bitmap,
|
||||
surface.TileSetRenderer.TileSize * surface.GetBrushLocation().X * surface.Zoom + surface.GetOffset().X,
|
||||
surface.TileSetRenderer.TileSize * surface.GetBrushLocation().Y * surface.Zoom + surface.GetOffset().Y,
|
||||
surface.TileSetRenderer.TileSize * surface.GetBrushLocation().Y * surface.Zoom + surface.GetOffset().Y,
|
||||
brushTemplate.Bitmap.Width * surface.Zoom,
|
||||
brushTemplate.Bitmap.Height * surface.Zoom);
|
||||
}
|
||||
|
||||
@@ -24,9 +24,9 @@ namespace OpenRA
|
||||
}
|
||||
Lazy<TypeDictionary> initDict;
|
||||
|
||||
public ActorReference( string type ) : this( type, new Dictionary<string, MiniYaml>() ) { }
|
||||
public ActorReference( string type ) : this(type, new Dictionary<string, MiniYaml>()) { }
|
||||
|
||||
public ActorReference( string type, Dictionary<string, MiniYaml> inits )
|
||||
public ActorReference(string type, Dictionary<string, MiniYaml> inits)
|
||||
{
|
||||
Type = type;
|
||||
initDict = Exts.Lazy(() =>
|
||||
@@ -47,17 +47,17 @@ namespace OpenRA
|
||||
|
||||
public MiniYaml Save()
|
||||
{
|
||||
var ret = new MiniYaml( Type );
|
||||
foreach( var init in InitDict )
|
||||
var ret = new MiniYaml(Type);
|
||||
foreach (var init in InitDict)
|
||||
{
|
||||
var initName = init.GetType().Name;
|
||||
ret.Nodes.Add( new MiniYamlNode( initName.Substring( 0, initName.Length - 4 ), FieldSaver.Save( init ) ) );
|
||||
ret.Nodes.Add(new MiniYamlNode(initName.Substring(0, initName.Length - 4), FieldSaver.Save(init)));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
// for initialization syntax
|
||||
public void Add( object o ) { InitDict.Add( o ); }
|
||||
public void Add(object o) { InitDict.Add(o); }
|
||||
public IEnumerator GetEnumerator() { return InitDict.GetEnumerator(); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,8 +173,8 @@ namespace OpenRA
|
||||
return fn();
|
||||
|
||||
var shouldCheckSync = Game.Settings.Debug.SanityCheckUnsyncedCode;
|
||||
int sync = shouldCheckSync ? world.SyncHash() : 0;
|
||||
bool prevInUnsyncedCode = inUnsyncedCode;
|
||||
var sync = shouldCheckSync ? world.SyncHash() : 0;
|
||||
var prevInUnsyncedCode = inUnsyncedCode;
|
||||
inUnsyncedCode = true;
|
||||
|
||||
try
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
|
||||
* Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
@@ -18,23 +18,23 @@ namespace OpenRA.Traits
|
||||
public Activity NextActivity { get; set; }
|
||||
protected bool IsCanceled { get; private set; }
|
||||
|
||||
public abstract Activity Tick( Actor self );
|
||||
public abstract Activity Tick(Actor self);
|
||||
|
||||
public virtual void Cancel( Actor self )
|
||||
public virtual void Cancel(Actor self)
|
||||
{
|
||||
IsCanceled = true;
|
||||
NextActivity = null;
|
||||
}
|
||||
|
||||
public virtual void Queue( Activity activity )
|
||||
public virtual void Queue(Activity activity)
|
||||
{
|
||||
if( NextActivity != null )
|
||||
NextActivity.Queue( activity );
|
||||
if (NextActivity != null)
|
||||
NextActivity.Queue(activity);
|
||||
else
|
||||
NextActivity = activity;
|
||||
}
|
||||
|
||||
public virtual IEnumerable<Target> GetTargets( Actor self )
|
||||
public virtual IEnumerable<Target> GetTargets(Actor self)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
@@ -42,12 +42,12 @@ namespace OpenRA.Traits
|
||||
|
||||
public static class ActivityExts
|
||||
{
|
||||
public static IEnumerable<Target> GetTargetQueue( this Actor self )
|
||||
public static IEnumerable<Target> GetTargetQueue(this Actor self)
|
||||
{
|
||||
return self.GetCurrentActivity()
|
||||
.Iterate( u => u.NextActivity )
|
||||
.TakeWhile( u => u != null )
|
||||
.SelectMany( u => u.GetTargets( self ) );
|
||||
.Iterate(u => u.NextActivity)
|
||||
.TakeWhile(u => u != null)
|
||||
.SelectMany(u => u.GetTargets(self));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,8 +209,8 @@ namespace OpenRA.Widgets
|
||||
substitutions.Add("PARENT_LEFT", parentBounds.Left);
|
||||
substitutions.Add("PARENT_TOP", parentBounds.Top);
|
||||
substitutions.Add("PARENT_BOTTOM", parentBounds.Height);
|
||||
int width = Evaluator.Evaluate(Width, substitutions);
|
||||
int height = Evaluator.Evaluate(Height, substitutions);
|
||||
var width = Evaluator.Evaluate(Width, substitutions);
|
||||
var height = Evaluator.Evaluate(Height, substitutions);
|
||||
|
||||
substitutions.Add("WIDTH", width);
|
||||
substitutions.Add("HEIGHT", height);
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace OpenRA
|
||||
}
|
||||
}
|
||||
|
||||
public Widget LoadWidget( WidgetArgs args, Widget parent, string w )
|
||||
public Widget LoadWidget(WidgetArgs args, Widget parent, string w)
|
||||
{
|
||||
MiniYamlNode ret;
|
||||
if (!widgets.TryGetValue(w, out ret))
|
||||
@@ -44,7 +44,7 @@ namespace OpenRA
|
||||
return LoadWidget( args, parent, ret );
|
||||
}
|
||||
|
||||
public Widget LoadWidget( WidgetArgs args, Widget parent, MiniYamlNode node)
|
||||
public Widget LoadWidget(WidgetArgs args, Widget parent, MiniYamlNode node)
|
||||
{
|
||||
var widget = NewWidget(node.Key, args);
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace OpenRA
|
||||
foreach (var c in child.Value.Nodes)
|
||||
LoadWidget( args, widget, c);
|
||||
|
||||
widget.PostInit( args );
|
||||
widget.PostInit(args);
|
||||
return widget;
|
||||
}
|
||||
|
||||
|
||||
@@ -80,8 +80,8 @@ namespace OpenRA.Mods.RA.Activities
|
||||
self.World.AddFrameEndTask(
|
||||
w => w.CreateActor(self.Info.Traits.Get<MinelayerInfo>().Mine, new TypeDictionary
|
||||
{
|
||||
new LocationInit( self.Location ),
|
||||
new OwnerInit( self.Owner ),
|
||||
new LocationInit(self.Location),
|
||||
new OwnerInit(self.Owner),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,9 +76,9 @@ namespace OpenRA.Mods.RA
|
||||
// Create a new actor for this bridge and keep track of which subtiles this bridge includes
|
||||
var bridge = w.CreateActor(BridgeTypes[tile].First, new TypeDictionary
|
||||
{
|
||||
new LocationInit( new CPos(ni, nj) ),
|
||||
new OwnerInit( w.WorldActor.Owner ),
|
||||
new HealthInit( BridgeTypes[tile].Second ),
|
||||
new LocationInit(new CPos(ni, nj)),
|
||||
new OwnerInit(w.WorldActor.Owner),
|
||||
new HealthInit(BridgeTypes[tile].Second),
|
||||
}).Trait<Bridge>();
|
||||
|
||||
var subTiles = new Dictionary<CPos, byte>();
|
||||
|
||||
@@ -59,8 +59,8 @@ namespace OpenRA.Mods.RA.Crates
|
||||
collector.World.AddFrameEndTask(
|
||||
w => w.CreateActor(Info.Unit, new TypeDictionary
|
||||
{
|
||||
new LocationInit( location.Value ),
|
||||
new OwnerInit( Info.Owner ?? collector.Owner.InternalName )
|
||||
new LocationInit(location.Value ),
|
||||
new OwnerInit(Info.Owner ?? collector.Owner.InternalName)
|
||||
}));
|
||||
|
||||
base.Activate(collector);
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.RA.Render
|
||||
{
|
||||
PlayerResources playerResources;
|
||||
|
||||
public RenderBuildingSilo( ActorInitializer init, RenderBuildingSiloInfo info )
|
||||
public RenderBuildingSilo(ActorInitializer init, RenderBuildingSiloInfo info)
|
||||
: base(init, info)
|
||||
{
|
||||
playerResources = init.self.Owner.PlayerActor.Trait<PlayerResources>();
|
||||
@@ -36,7 +36,7 @@ namespace OpenRA.Mods.RA.Render
|
||||
: 0);
|
||||
}
|
||||
|
||||
public void OnCapture (Actor self, Actor captor, Player oldOwner, Player newOwner)
|
||||
public void OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner)
|
||||
{
|
||||
playerResources = newOwner.PlayerActor.Trait<PlayerResources>();
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace OpenRA.Mods.RA
|
||||
var cargo = a.Trait<Cargo>();
|
||||
foreach (var i in items)
|
||||
cargo.Load(a, self.World.CreateActor(false, i.ToLowerInvariant(),
|
||||
new TypeDictionary { new OwnerInit( a.Owner ) }));
|
||||
new TypeDictionary { new OwnerInit(a.Owner) }));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user