From 1e2e7bcf423108ee3b39d7473895d85d35b693fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Fri, 4 Jul 2014 17:14:48 +0200 Subject: [PATCH] StyleCop --- OpenRA.Mods.RA/AI/HackyAI.cs | 2 +- OpenRA.Mods.RA/Air/TakeOff.cs | 2 +- OpenRA.Mods.RA/Effects/RallyPoint.cs | 4 ++-- OpenRA.Mods.RA/Production.cs | 2 +- OpenRA.Mods.RA/RallyPoint.cs | 15 ++++++++------- OpenRA.Mods.RA/Repairable.cs | 4 ++-- mods/common/lua/production.lua | 2 +- 7 files changed, 16 insertions(+), 15 deletions(-) mode change 100755 => 100644 OpenRA.Mods.RA/Effects/RallyPoint.cs diff --git a/OpenRA.Mods.RA/AI/HackyAI.cs b/OpenRA.Mods.RA/AI/HackyAI.cs index 304b3295c2..ec1179c03e 100644 --- a/OpenRA.Mods.RA/AI/HackyAI.cs +++ b/OpenRA.Mods.RA/AI/HackyAI.cs @@ -674,7 +674,7 @@ namespace OpenRA.Mods.RA.AI { var buildings = self.World.ActorsWithTrait() .Where(rp => rp.Actor.Owner == p && - !IsRallyPointValid(rp.Trait.rallyPoint, rp.Actor.Info.Traits.GetOrDefault())).ToArray(); + !IsRallyPointValid(rp.Trait.Location, rp.Actor.Info.Traits.GetOrDefault())).ToArray(); if (buildings.Length > 0) BotDebug("Bot {0} needs to find rallypoints for {1} buildings.", diff --git a/OpenRA.Mods.RA/Air/TakeOff.cs b/OpenRA.Mods.RA/Air/TakeOff.cs index 6e9d728800..02689538e8 100644 --- a/OpenRA.Mods.RA/Air/TakeOff.cs +++ b/OpenRA.Mods.RA/Air/TakeOff.cs @@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA.Air var hasHost = host != null; var rp = hasHost ? host.TraitOrDefault() : null; - var destination = rp != null ? rp.rallyPoint : + var destination = rp != null ? rp.Location : (hasHost ? self.World.Map.CellContaining(host.CenterPosition) : self.Location); return new AttackMove.AttackMoveActivity(self, self.Trait().MoveTo(destination, 1)); diff --git a/OpenRA.Mods.RA/Effects/RallyPoint.cs b/OpenRA.Mods.RA/Effects/RallyPoint.cs old mode 100755 new mode 100644 index de9ed6cd30..92cc8cc1bd --- a/OpenRA.Mods.RA/Effects/RallyPoint.cs +++ b/OpenRA.Mods.RA/Effects/RallyPoint.cs @@ -42,9 +42,9 @@ namespace OpenRA.Mods.RA.Effects { flag.Tick(); circles.Tick(); - if (cachedLocation != rp.rallyPoint) + if (cachedLocation != rp.Location) { - cachedLocation = rp.rallyPoint; + cachedLocation = rp.Location; circles.Play("circles"); } diff --git a/OpenRA.Mods.RA/Production.cs b/OpenRA.Mods.RA/Production.cs index 5f15a038e4..e4b38f1182 100755 --- a/OpenRA.Mods.RA/Production.cs +++ b/OpenRA.Mods.RA/Production.cs @@ -62,7 +62,7 @@ namespace OpenRA.Mods.RA var fi = producee.Traits.Get(); var initialFacing = exitinfo.Facing < 0 ? Util.GetFacing(to - spawn, fi.GetInitialFacing()) : exitinfo.Facing; - var exitLocation = rp.Value != null ? rp.Value.rallyPoint : exit; + var exitLocation = rp.Value != null ? rp.Value.Location : exit; var target = Target.FromCell(self.World, exitLocation); self.World.AddFrameEndTask(w => diff --git a/OpenRA.Mods.RA/RallyPoint.cs b/OpenRA.Mods.RA/RallyPoint.cs index 24289b0167..6875d68be2 100644 --- a/OpenRA.Mods.RA/RallyPoint.cs +++ b/OpenRA.Mods.RA/RallyPoint.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, @@ -24,11 +24,11 @@ namespace OpenRA.Mods.RA public class RallyPoint : IIssueOrder, IResolveOrder, ISync { - [Sync] public CPos rallyPoint; + [Sync] public CPos Location; public RallyPoint(Actor self, RallyPointInfo info) { - rallyPoint = self.Location + info.RallyPoint; + Location = self.Location + info.RallyPoint; self.World.AddFrameEndTask(w => w.Add(new Effects.RallyPoint(self, info.IndicatorPalettePrefix))); } @@ -37,7 +37,7 @@ namespace OpenRA.Mods.RA get { yield return new RallyPointOrderTargeter(); } } - public Order IssueOrder( Actor self, IOrderTargeter order, Target target, bool queued ) + public Order IssueOrder(Actor self, IOrderTargeter order, Target target, bool queued) { if (order.OrderID == "SetRallyPoint") return new Order(order.OrderID, self, false) { TargetLocation = self.World.Map.CellContaining(target.CenterPosition), SuppressVisualFeedback = true }; @@ -45,10 +45,10 @@ namespace OpenRA.Mods.RA return null; } - public void ResolveOrder( Actor self, Order order ) + public void ResolveOrder(Actor self, Order order) { - if( order.OrderString == "SetRallyPoint" ) - rallyPoint = order.TargetLocation; + if (order.OrderString == "SetRallyPoint") + Location = order.TargetLocation; } class RallyPointOrderTargeter : IOrderTargeter @@ -67,6 +67,7 @@ namespace OpenRA.Mods.RA cursor = "ability"; return true; } + return false; } diff --git a/OpenRA.Mods.RA/Repairable.cs b/OpenRA.Mods.RA/Repairable.cs index 87d1b36408..14758a2f52 100644 --- a/OpenRA.Mods.RA/Repairable.cs +++ b/OpenRA.Mods.RA/Repairable.cs @@ -86,8 +86,8 @@ namespace OpenRA.Mods.RA if (rp != null) self.QueueActivity(new CallFunc(() => { - self.SetTargetLine(Target.FromCell(self.World, rp.rallyPoint), Color.Green); - self.QueueActivity(movement.MoveTo(rp.rallyPoint, order.TargetActor)); + self.SetTargetLine(Target.FromCell(self.World, rp.Location), Color.Green); + self.QueueActivity(movement.MoveTo(rp.Location, order.TargetActor)); })); } } diff --git a/mods/common/lua/production.lua b/mods/common/lua/production.lua index 04d2fdfd75..09290015d3 100644 --- a/mods/common/lua/production.lua +++ b/mods/common/lua/production.lua @@ -31,7 +31,7 @@ end Production.SetRallyPoint = function(factory, location) local srp = Actor.Trait(factory, "RallyPoint") if srp ~= nil then - srp.rallyPoint = location.Location + srp.Location = location.Location end end