diff --git a/OpenRA.Editor/BrushTool.cs b/OpenRA.Editor/BrushTool.cs index b6244be439..c12eed8acb 100644 --- a/OpenRA.Editor/BrushTool.cs +++ b/OpenRA.Editor/BrushTool.cs @@ -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); } diff --git a/OpenRA.Game/Map/ActorReference.cs b/OpenRA.Game/Map/ActorReference.cs index d427d51a14..9ad5810c2a 100755 --- a/OpenRA.Game/Map/ActorReference.cs +++ b/OpenRA.Game/Map/ActorReference.cs @@ -24,9 +24,9 @@ namespace OpenRA } Lazy initDict; - public ActorReference( string type ) : this( type, new Dictionary() ) { } + public ActorReference( string type ) : this(type, new Dictionary()) { } - public ActorReference( string type, Dictionary inits ) + public ActorReference(string type, Dictionary 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(); } } } diff --git a/OpenRA.Game/Sync.cs b/OpenRA.Game/Sync.cs index e7bf57c274..2425d02912 100755 --- a/OpenRA.Game/Sync.cs +++ b/OpenRA.Game/Sync.cs @@ -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 diff --git a/OpenRA.Game/Traits/Activity.cs b/OpenRA.Game/Traits/Activity.cs index 7ffbd0512f..825947856f 100644 --- a/OpenRA.Game/Traits/Activity.cs +++ b/OpenRA.Game/Traits/Activity.cs @@ -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 GetTargets( Actor self ) + public virtual IEnumerable GetTargets(Actor self) { yield break; } @@ -42,12 +42,12 @@ namespace OpenRA.Traits public static class ActivityExts { - public static IEnumerable GetTargetQueue( this Actor self ) + public static IEnumerable 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)); } } } diff --git a/OpenRA.Game/Widgets/Widget.cs b/OpenRA.Game/Widgets/Widget.cs index 9d263ac3ba..6df3dfdb54 100644 --- a/OpenRA.Game/Widgets/Widget.cs +++ b/OpenRA.Game/Widgets/Widget.cs @@ -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); diff --git a/OpenRA.Game/Widgets/WidgetLoader.cs b/OpenRA.Game/Widgets/WidgetLoader.cs index 4e5618ab22..a3f9d65b0e 100644 --- a/OpenRA.Game/Widgets/WidgetLoader.cs +++ b/OpenRA.Game/Widgets/WidgetLoader.cs @@ -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; } diff --git a/OpenRA.Mods.RA/Activities/LayMines.cs b/OpenRA.Mods.RA/Activities/LayMines.cs index 7d2955a736..5de39b7531 100644 --- a/OpenRA.Mods.RA/Activities/LayMines.cs +++ b/OpenRA.Mods.RA/Activities/LayMines.cs @@ -80,8 +80,8 @@ namespace OpenRA.Mods.RA.Activities self.World.AddFrameEndTask( w => w.CreateActor(self.Info.Traits.Get().Mine, new TypeDictionary { - new LocationInit( self.Location ), - new OwnerInit( self.Owner ), + new LocationInit(self.Location), + new OwnerInit(self.Owner), })); } } diff --git a/OpenRA.Mods.RA/BridgeLayer.cs b/OpenRA.Mods.RA/BridgeLayer.cs index e09fbd2330..d631aa092f 100644 --- a/OpenRA.Mods.RA/BridgeLayer.cs +++ b/OpenRA.Mods.RA/BridgeLayer.cs @@ -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(); var subTiles = new Dictionary(); diff --git a/OpenRA.Mods.RA/Crates/GiveUnitCrateAction.cs b/OpenRA.Mods.RA/Crates/GiveUnitCrateAction.cs index 9e506d1e77..d23de5b112 100644 --- a/OpenRA.Mods.RA/Crates/GiveUnitCrateAction.cs +++ b/OpenRA.Mods.RA/Crates/GiveUnitCrateAction.cs @@ -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); diff --git a/OpenRA.Mods.RA/Render/RenderBuildingSilo.cs b/OpenRA.Mods.RA/Render/RenderBuildingSilo.cs index 7c524b5574..0fc5d5fa17 100755 --- a/OpenRA.Mods.RA/Render/RenderBuildingSilo.cs +++ b/OpenRA.Mods.RA/Render/RenderBuildingSilo.cs @@ -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(); @@ -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(); } diff --git a/OpenRA.Mods.RA/SupportPowers/ParatroopersPower.cs b/OpenRA.Mods.RA/SupportPowers/ParatroopersPower.cs index b09ce2dd5f..9eb2730673 100644 --- a/OpenRA.Mods.RA/SupportPowers/ParatroopersPower.cs +++ b/OpenRA.Mods.RA/SupportPowers/ParatroopersPower.cs @@ -70,7 +70,7 @@ namespace OpenRA.Mods.RA var cargo = a.Trait(); 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) })); }); } }