Remove explicit private.

Remove unnecessary delegate.
Use extension method syntax.
Fix HealthInfo.NotifyAppliedDamage’s desc.
Remove unused using directives.
Remove explicit type declaration in Manifest.
This commit is contained in:
Taryn Hill
2015-04-02 12:40:40 -05:00
parent 87b7cc4527
commit 96d6ea79ce
5 changed files with 6 additions and 7 deletions

View File

@@ -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

View File

@@ -10,7 +10,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using OpenRA.Primitives;

View File

@@ -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
{

View File

@@ -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)

View File

@@ -37,7 +37,7 @@ namespace OpenRA
class ActorIDComparer : IComparer<Actor>
{
public static readonly ActorIDComparer Instance = new ActorIDComparer();
private ActorIDComparer() { }
ActorIDComparer() { }
public int Compare(Actor x, Actor y) { return x.ActorID.CompareTo(y.ActorID); }
}