From 96d6ea79ce55e11ca13e36198fc5f1c740553684 Mon Sep 17 00:00:00 2001 From: Taryn Hill Date: Thu, 2 Apr 2015 12:40:40 -0500 Subject: [PATCH] =?UTF-8?q?Remove=20explicit=20private.=20Remove=20unneces?= =?UTF-8?q?sary=20delegate.=20Use=20extension=20method=20syntax.=20Fix=20H?= =?UTF-8?q?ealthInfo.NotifyAppliedDamage=E2=80=99s=20desc.=20Remove=20unus?= =?UTF-8?q?ed=20using=20directives.=20Remove=20explicit=20type=20declarati?= =?UTF-8?q?on=20in=20Manifest.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OpenRA.Game/Manifest.cs | 2 +- OpenRA.Game/ObjectCreator.cs | 1 - OpenRA.Game/Traits/Health.cs | 6 +++--- OpenRA.Game/Traits/World/Shroud.cs | 2 +- OpenRA.Game/World.cs | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/OpenRA.Game/Manifest.cs b/OpenRA.Game/Manifest.cs index fe3945141e..3dc5504822 100644 --- a/OpenRA.Game/Manifest.cs +++ b/OpenRA.Game/Manifest.cs @@ -167,7 +167,7 @@ namespace OpenRA throw new InvalidDataException("`{0}` is not a valid mod manifest entry.".F(kv.Key)); IGlobalModData module; - var ctor = t.GetConstructor(new Type[] { typeof(MiniYaml) }); + var ctor = t.GetConstructor(new[] { typeof(MiniYaml) }); if (ctor != null) { // Class has opted-in to DIY initialization diff --git a/OpenRA.Game/ObjectCreator.cs b/OpenRA.Game/ObjectCreator.cs index 06332958ee..e28636d6a4 100755 --- a/OpenRA.Game/ObjectCreator.cs +++ b/OpenRA.Game/ObjectCreator.cs @@ -10,7 +10,6 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; using System.Reflection; using OpenRA.Primitives; diff --git a/OpenRA.Game/Traits/Health.cs b/OpenRA.Game/Traits/Health.cs index c6d29ac892..4cb4b736ba 100755 --- a/OpenRA.Game/Traits/Health.cs +++ b/OpenRA.Game/Traits/Health.cs @@ -18,10 +18,10 @@ namespace OpenRA.Traits [Desc("HitPoints")] public readonly int HP = 0; - [Desc("Physical size of the unit used for damage calculations. Impacts within this radius apply full damage")] + [Desc("Physical size of the unit used for damage calculations. Impacts within this radius apply full damage.")] public readonly WRange Radius = new WRange(426); - [Desc("Don't trigger interfaces such as AnnounceOnKill.")] + [Desc("Trigger interfaces such as AnnounceOnKill?")] public readonly bool NotifyAppliedDamage = true; public virtual object Create(ActorInitializer init) { return new Health(init, this); } @@ -122,7 +122,7 @@ namespace OpenRA.Traits damage = Util.ApplyPercentageModifiers(damage, modifiers); } - hp = Exts.Clamp(hp - damage, 0, MaxHP); + hp = (hp - damage).Clamp(0, MaxHP); var ai = new AttackInfo { diff --git a/OpenRA.Game/Traits/World/Shroud.cs b/OpenRA.Game/Traits/World/Shroud.cs index 67fd8f42a6..b3c6746fbe 100644 --- a/OpenRA.Game/Traits/World/Shroud.cs +++ b/OpenRA.Game/Traits/World/Shroud.cs @@ -331,7 +331,7 @@ namespace OpenRA.Traits public bool IsExplored(Actor a) { - return GetVisOrigins(a).Any(o => IsExplored(o)); + return GetVisOrigins(a).Any(IsExplored); } public bool IsVisible(CPos cell) diff --git a/OpenRA.Game/World.cs b/OpenRA.Game/World.cs index 5d6238ef2b..43bf359b3f 100644 --- a/OpenRA.Game/World.cs +++ b/OpenRA.Game/World.cs @@ -37,7 +37,7 @@ namespace OpenRA class ActorIDComparer : IComparer { public static readonly ActorIDComparer Instance = new ActorIDComparer(); - private ActorIDComparer() { } + ActorIDComparer() { } public int Compare(Actor x, Actor y) { return x.ActorID.CompareTo(y.ActorID); } }