diff --git a/OpenRA.Game/Activities/Activity.cs b/OpenRA.Game/Activities/Activity.cs index a0de19e1f3..5df407b7ff 100644 --- a/OpenRA.Game/Activities/Activity.cs +++ b/OpenRA.Game/Activities/Activity.cs @@ -51,7 +51,7 @@ namespace OpenRA.Activities public Activity TickOuter(Actor self) { if (State == ActivityState.Done && Game.Settings.Debug.StrictActivityChecking) - throw new InvalidOperationException("Actor {0} attempted to tick activity {1} after it had already completed.".F(self, this.GetType())); + throw new InvalidOperationException("Actor {0} attempted to tick activity {1} after it had already completed.".F(self, GetType())); if (State == ActivityState.Queued) { @@ -147,7 +147,7 @@ namespace OpenRA.Activities if (origin == this) Console.Write("*"); - Console.WriteLine(this.GetType().ToString().Split('.').Last()); + Console.WriteLine(GetType().ToString().Split('.').Last()); if (ChildActivity != null) ChildActivity.PrintActivityTree(self, origin, level + 1); diff --git a/OpenRA.Game/Actor.cs b/OpenRA.Game/Actor.cs index 4a866151d1..47a3364e38 100644 --- a/OpenRA.Game/Actor.cs +++ b/OpenRA.Game/Actor.cs @@ -412,7 +412,7 @@ namespace OpenRA if (enabledTargetablePositionTraits.Any()) return enabledTargetablePositionTraits.SelectMany(tp => tp.TargetablePositions(this)); - return new[] { this.CenterPosition }; + return new[] { CenterPosition }; } #region Scripting interface diff --git a/OpenRA.Game/Renderer.cs b/OpenRA.Game/Renderer.cs index e1f41dcc31..c46309955d 100644 --- a/OpenRA.Game/Renderer.cs +++ b/OpenRA.Game/Renderer.cs @@ -114,9 +114,10 @@ namespace OpenRA // - a small margin so that tiles rendered partially above the top edge of the screen aren't pushed behind the clip plane // We need an offset of mapGrid.MaximumTerrainHeight * mapGrid.TileSize.Height / 2 to cover the terrain height // and choose to use mapGrid.MaximumTerrainHeight * mapGrid.TileSize.Height / 4 for each of the actor and top-edge cases - this.depthScale = mapGrid == null || !mapGrid.EnableDepthBuffer ? 0 : + depthScale = mapGrid == null || !mapGrid.EnableDepthBuffer ? 0 : (float)Resolution.Height / (Resolution.Height + mapGrid.TileSize.Height * mapGrid.MaximumTerrainHeight); - this.depthOffset = this.depthScale / 2; + + depthOffset = depthScale / 2; } public void BeginFrame(int2 scroll, float zoom) diff --git a/OpenRA.Mods.Common/Activities/HarvestResource.cs b/OpenRA.Mods.Common/Activities/HarvestResource.cs index fac0a3ce3f..4fb9e1f775 100644 --- a/OpenRA.Mods.Common/Activities/HarvestResource.cs +++ b/OpenRA.Mods.Common/Activities/HarvestResource.cs @@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Activities readonly IMove move; readonly CPos targetCell; - public HarvestResource(Actor self, CPos targetcell) + public HarvestResource(Actor self, CPos targetCell) { harv = self.Trait(); harvInfo = self.Info.TraitInfo(); @@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Activities move = self.Trait(); claimLayer = self.World.WorldActor.Trait(); resLayer = self.World.WorldActor.Trait(); - this.targetCell = targetcell; + this.targetCell = targetCell; } protected override void OnFirstRun(Actor self) diff --git a/OpenRA.Mods.Common/Graphics/RailgunRenderable.cs b/OpenRA.Mods.Common/Graphics/RailgunRenderable.cs index feb46c1ff2..a0e52455c8 100644 --- a/OpenRA.Mods.Common/Graphics/RailgunRenderable.cs +++ b/OpenRA.Mods.Common/Graphics/RailgunRenderable.cs @@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.Graphics this.pos = pos; this.zOffset = zOffset; this.railgun = railgun; - this.info = railgunInfo; + info = railgunInfo; this.ticks = ticks; helixRadius = info.HelixRadius + new WDist(ticks * info.HelixRadiusDeltaPerTick); @@ -59,7 +59,7 @@ namespace OpenRA.Mods.Common.Graphics var screenWidth = wr.ScreenVector(new WVec(info.HelixThickness.Length, 0, 0))[0]; // Move forward from self to target to draw helix - var centerPos = this.pos; + var centerPos = pos; var points = new float3[railgun.CycleCount * info.QuantizationCount]; for (var i = points.Length - 1; i >= 0; i--) { diff --git a/OpenRA.Mods.Common/Projectiles/Railgun.cs b/OpenRA.Mods.Common/Projectiles/Railgun.cs index 79032ba6fe..e227c9e126 100644 --- a/OpenRA.Mods.Common/Projectiles/Railgun.cs +++ b/OpenRA.Mods.Common/Projectiles/Railgun.cs @@ -125,8 +125,8 @@ namespace OpenRA.Mods.Common.Projectiles this.info = info; target = args.PassiveTarget; - this.BeamColor = beamColor; - this.HelixColor = helixColor; + BeamColor = beamColor; + HelixColor = helixColor; if (!string.IsNullOrEmpty(info.HitAnim)) hitanim = new Animation(args.SourceActor.World, info.HitAnim); diff --git a/OpenRA.Mods.Common/Traits/Attack/AttackFrontal.cs b/OpenRA.Mods.Common/Traits/Attack/AttackFrontal.cs index d1f072bd1d..166f8e8d7d 100644 --- a/OpenRA.Mods.Common/Traits/Attack/AttackFrontal.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackFrontal.cs @@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Traits public AttackFrontal(Actor self, AttackFrontalInfo info) : base(self, info) { - this.Info = info; + Info = info; } protected override bool CanAttack(Actor self, Target target) diff --git a/OpenRA.Mods.Common/Traits/Conditions/GrantExternalConditionToCrusher.cs b/OpenRA.Mods.Common/Traits/Conditions/GrantExternalConditionToCrusher.cs index 78bb19d8a2..ca350bac84 100644 --- a/OpenRA.Mods.Common/Traits/Conditions/GrantExternalConditionToCrusher.cs +++ b/OpenRA.Mods.Common/Traits/Conditions/GrantExternalConditionToCrusher.cs @@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits public GrantExternalConditionToCrusher(Actor self, GrantExternalConditionToCrusherInfo info) { - this.Info = info; + Info = info; } void INotifyCrushed.OnCrush(Actor self, Actor crusher, BitSet crushClasses) diff --git a/OpenRA.Mods.Common/Traits/Player/ModularBot.cs b/OpenRA.Mods.Common/Traits/Player/ModularBot.cs index 327fdf7b89..980bcefbcc 100644 --- a/OpenRA.Mods.Common/Traits/Player/ModularBot.cs +++ b/OpenRA.Mods.Common/Traits/Player/ModularBot.cs @@ -57,7 +57,7 @@ namespace OpenRA.Mods.Common.Traits public ModularBot(ModularBotInfo info, ActorInitializer init) { this.info = info; - this.world = init.World; + world = init.World; } // Called by the host's player creation code diff --git a/OpenRA.Mods.Common/Traits/Render/RenderRangeCircle.cs b/OpenRA.Mods.Common/Traits/Render/RenderRangeCircle.cs index 289bb865bd..899a91fa52 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderRangeCircle.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderRangeCircle.cs @@ -50,8 +50,8 @@ namespace OpenRA.Mods.Common.Traits.Render centerPosition, range.Value, 0, - this.Color, - this.BorderColor); + Color, + BorderColor); var otherRanges = w.ActorsWithTrait() .Where(a => a.Trait.Info.RangeCircleType == RangeCircleType) diff --git a/OpenRA.Mods.Common/Traits/World/Selection.cs b/OpenRA.Mods.Common/Traits/World/Selection.cs index 9e932817e5..5e138d6077 100644 --- a/OpenRA.Mods.Common/Traits/World/Selection.cs +++ b/OpenRA.Mods.Common/Traits/World/Selection.cs @@ -34,7 +34,7 @@ namespace OpenRA.Mods.Common.Traits void INotifyCreated.Created(Actor self) { - this.worldNotifySelection = self.TraitsImplementing().ToArray(); + worldNotifySelection = self.TraitsImplementing().ToArray(); } void UpdateHash() diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/CommonSelectorLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/CommonSelectorLogic.cs index b4efc2b53a..c8faba3d15 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/CommonSelectorLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/CommonSelectorLogic.cs @@ -35,9 +35,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic public CommonSelectorLogic(Widget widget, World world, WorldRenderer worldRenderer, string templateListId, string previewTemplateId) { - this.Widget = widget; - this.World = world; - this.WorldRenderer = worldRenderer; + Widget = widget; + World = world; + WorldRenderer = worldRenderer; Editor = widget.Parent.Get("MAP_EDITOR"); Panel = widget.Get(templateListId); ItemTemplate = Panel.Get(previewTemplateId); diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameChatLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameChatLogic.cs index a74fd1496d..adea6e196d 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameChatLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameChatLogic.cs @@ -43,7 +43,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic public IngameChatLogic(Widget widget, OrderManager orderManager, World world, ModData modData, bool isMenuChat, Dictionary logicArgs) { this.orderManager = orderManager; - this.modRules = modData.DefaultRules; + modRules = modData.DefaultRules; chatTraits = world.WorldActor.TraitsImplementing().ToArray(); diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs index 4d4fc33fd5..7d2dae41b8 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs @@ -108,7 +108,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic this.skirmishMode = skirmishMode; // TODO: This needs to be reworked to support per-map tech levels, bots, etc. - this.modRules = modData.DefaultRules; + modRules = modData.DefaultRules; shellmapWorld = worldRenderer.World; services = modData.Manifest.Get(); diff --git a/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs b/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs index 4d7ebd761c..55e5c9cd00 100644 --- a/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs @@ -104,7 +104,7 @@ namespace OpenRA.Mods.Common.Widgets [ObjectCreator.UseCtor] public ScrollPanelWidget(ModData modData) { - this.modRules = modData.DefaultRules; + modRules = modData.DefaultRules; Layout = new ListLayout(this); }