Fix CA1822

This commit is contained in:
RoosterDragon
2023-03-12 16:24:19 +00:00
committed by Pavel Penev
parent e4cac1fffc
commit 277699cbd5
77 changed files with 109 additions and 105 deletions

View File

@@ -444,7 +444,7 @@ namespace OpenRA.Mods.Common.Traits
return chosenTarget;
}
bool PreventsAutoTarget(Actor attacker, Actor target)
static bool PreventsAutoTarget(Actor attacker, Actor target)
{
foreach (var deat in target.TraitsImplementing<IDisableEnemyAutoTarget>())
if (deat.DisableEnemyAutoTarget(target, attacker))

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads
return ShouldFlee(owner, enemies => !AttackOrFleeFuzzy.Default.CanAttack(owner.Units, enemies));
}
protected Actor FindClosestEnemy(Squad owner)
protected static Actor FindClosestEnemy(Squad owner)
{
return owner.SquadManager.FindClosestEnemy(owner.Units.First().CenterPosition);
}

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads
return ShouldFlee(owner, enemies => !AttackOrFleeFuzzy.Default.CanAttack(owner.Units, enemies));
}
protected Actor FindClosestEnemy(Squad owner)
protected static Actor FindClosestEnemy(Squad owner)
{
var first = owner.Units.First();

View File

@@ -90,7 +90,7 @@ namespace OpenRA.Mods.Common.Traits
}
}
bool TargetChanged(in Target lastTarget, in Target target)
static bool TargetChanged(in Target lastTarget, in Target target)
{
// Invalidate reveal changing the target.
if (lastTarget.Type == TargetType.FrozenActor && target.Type == TargetType.Actor)

View File

@@ -82,7 +82,7 @@ namespace OpenRA.Mods.Common.Traits
return RenderAboveShroud(self, wr);
}
IEnumerable<IRenderable> RenderAboveShroud(Actor self, WorldRenderer wr)
static IEnumerable<IRenderable> RenderAboveShroud(Actor self, WorldRenderer wr)
{
var pal = wr.Palette(TileSet.TerrainPaletteInternalName);
var a = self.CurrentActivity;

View File

@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Traits.Render
decorations = selectedDecorations.Where(d => !d.RequiresSelection).ToArray();
}
IEnumerable<WPos> ActivityTargetPath(Actor self)
static IEnumerable<WPos> ActivityTargetPath(Actor self)
{
if (!self.IsInWorld || self.IsDead)
yield break;

View File

@@ -64,7 +64,7 @@ namespace OpenRA.Mods.Common.Traits
}
}
Player GetTargetPlayer(in Target target)
static Player GetTargetPlayer(in Target target)
{
if (target.Type == TargetType.Actor)
return target.Actor.Owner;

View File

@@ -345,7 +345,7 @@ namespace OpenRA.Mods.Common.Traits
}
// NOTE: pos required to be in map bounds
bool AnyActorsAt(InfluenceNode influenceNode, CPos a, SubCell sub, bool checkTransient)
static bool AnyActorsAt(InfluenceNode influenceNode, CPos a, SubCell sub, bool checkTransient)
{
var always = sub == SubCell.FullCell || sub == SubCell.Any;
for (var i = influenceNode; i != null; i = i.Next)
@@ -376,7 +376,7 @@ namespace OpenRA.Mods.Common.Traits
}
// NOTE: can not check aircraft
bool AnyActorsAt(InfluenceNode influenceNode, SubCell sub, Func<Actor, bool> withCondition)
static bool AnyActorsAt(InfluenceNode influenceNode, SubCell sub, Func<Actor, bool> withCondition)
{
var always = sub == SubCell.FullCell || sub == SubCell.Any;

View File

@@ -119,7 +119,7 @@ namespace OpenRA.Mods.Common.Traits
&& world.Map.Rules.Music[song].Exists;
}
bool SongExists(MusicInfo song)
static bool SongExists(MusicInfo song)
{
return song != null && song.Exists;
}

View File

@@ -55,7 +55,7 @@ namespace OpenRA.Mods.Common.Traits
}
}
bool PreventMapSpawn(World world, ActorReference actorReference, IEnumerable<IPreventMapSpawn> preventMapSpawns)
static bool PreventMapSpawn(World world, ActorReference actorReference, IEnumerable<IPreventMapSpawn> preventMapSpawns)
{
foreach (var pms in preventMapSpawns)
if (pms.PreventMapSpawn(world, actorReference))

View File

@@ -75,7 +75,7 @@ namespace OpenRA.Mods.Common.Traits
info.BinSize * tileScale);
}
Rectangle Bounds(LightSource source)
static Rectangle Bounds(LightSource source)
{
var c = source.Pos;
var r = source.Range.Length;