Remove unused parameters.

This commit is contained in:
Matthias Mailänder
2022-03-13 12:02:52 +01:00
committed by abcdefg30
parent ea243b8558
commit 0e7ad43425
205 changed files with 451 additions and 455 deletions

View File

@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Cnc.Activities
int ticks = 0;
WPos targetPosition;
public Leap(Actor self, in Target target, Mobile mobile, Mobile targetMobile, int speed, AttackLeap attack, EdibleByLeap edible)
public Leap(in Target target, Mobile mobile, Mobile targetMobile, int speed, AttackLeap attack, EdibleByLeap edible)
{
this.mobile = mobile;
this.targetMobile = targetMobile;
@@ -93,7 +93,7 @@ namespace OpenRA.Mods.Cnc.Activities
// Update movement which results in movementType set to MovementType.None.
// This is needed to prevent the move animation from playing.
mobile.UpdateMovement(self);
mobile.UpdateMovement();
// Revoke the condition before attacking, as it is usually used to pause the attack trait
attack.RevokeLeapCondition(self);

View File

@@ -138,7 +138,7 @@ namespace OpenRA.Mods.Cnc.Activities
return false;
}
QueueChild(new Leap(self, target, mobile, targetMobile, info.Speed.Length, attack, edible));
QueueChild(new Leap(target, mobile, targetMobile, info.Speed.Length, attack, edible));
// Re-queue the child activities to kill the target if it didn't die in one go
return false;

View File

@@ -21,6 +21,7 @@ namespace OpenRA.Mods.Cnc.Graphics
{
public Action<string> OnMissingModelError { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "IDE0060:Remove unused parameter", Justification = "Load game API")]
public VoxelModelSequenceLoader(ModData modData) { }
public IModelCache CacheModels(IReadOnlyFileSystem fileSystem, ModData modData, IReadOnlyDictionary<string, MiniYamlNode> modelSequences)

View File

@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Cnc.Traits
public override Activity GetAttackActivity(Actor self, AttackSource source, in Target newTarget, bool allowMove, bool forceAttack, Color? targetLineColor)
{
return new AttackTDGunboatTurretedActivity(self, newTarget, allowMove, forceAttack, targetLineColor);
return new AttackTDGunboatTurretedActivity(self, newTarget, forceAttack, targetLineColor);
}
class AttackTDGunboatTurretedActivity : Activity
@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Cnc.Traits
readonly Color? targetLineColor;
bool hasTicked;
public AttackTDGunboatTurretedActivity(Actor self, in Target target, bool allowMove, bool forceAttack, Color? targetLineColor = null)
public AttackTDGunboatTurretedActivity(Actor self, in Target target, bool forceAttack, Color? targetLineColor = null)
{
attack = self.Trait<AttackTDGunboatTurreted>();
this.target = target;
@@ -66,7 +66,7 @@ namespace OpenRA.Mods.Cnc.Traits
if (hasTicked && attack.RequestedTarget.Type == TargetType.Invalid)
return true;
attack.SetRequestedTarget(self, target);
attack.SetRequestedTarget(target);
hasTicked = true;
}

View File

@@ -26,14 +26,14 @@ namespace OpenRA.Mods.Cnc.Traits
[Desc("Damage is divided by this number when converting damage to drain ticks.")]
public readonly int DamageDivisor = 600;
public override object Create(ActorInitializer init) { return new DrainPrerequisitePowerOnDamage(init.Self, this); }
public override object Create(ActorInitializer init) { return new DrainPrerequisitePowerOnDamage(this); }
}
public class DrainPrerequisitePowerOnDamage : ConditionalTrait<DrainPrerequisitePowerOnDamageInfo>, INotifyOwnerChanged, IDamageModifier
{
SupportPowerManager spm;
public DrainPrerequisitePowerOnDamage(Actor self, DrainPrerequisitePowerOnDamageInfo info)
public DrainPrerequisitePowerOnDamage(DrainPrerequisitePowerOnDamageInfo info)
: base(info) { }
protected override void Created(Actor self)

View File

@@ -30,14 +30,14 @@ namespace OpenRA.Mods.Cnc.Traits
[Desc("Sound the perpetrator will hear after successful infiltration.")]
public readonly string InfiltrationNotification = null;
public override object Create(ActorInitializer init) { return new InfiltrateForExploration(init.Self, this); }
public override object Create(ActorInitializer init) { return new InfiltrateForExploration(this); }
}
class InfiltrateForExploration : INotifyInfiltrated
{
readonly InfiltrateForExplorationInfo info;
public InfiltrateForExploration(Actor self, InfiltrateForExplorationInfo info)
public InfiltrateForExploration(InfiltrateForExplorationInfo info)
{
this.info = info;
}

View File

@@ -75,7 +75,7 @@ namespace OpenRA.Mods.Cnc.Traits
return new Order(order.OrderID, self, target, queued);
}
bool IsValidOrder(Actor self, Order order)
bool IsValidOrder(Order order)
{
if (IsTraitDisabled)
return false;
@@ -92,7 +92,7 @@ namespace OpenRA.Mods.Cnc.Traits
public string VoicePhraseForOrder(Actor self, Order order)
{
return order.OrderString == "Infiltrate" && IsValidOrder(self, order)
return order.OrderString == "Infiltrate" && IsValidOrder(order)
? Info.Voice : null;
}
@@ -113,7 +113,7 @@ namespace OpenRA.Mods.Cnc.Traits
public void ResolveOrder(Actor self, Order order)
{
if (order.OrderString != "Infiltrate" || !IsValidOrder(self, order) || IsTraitDisabled)
if (order.OrderString != "Infiltrate" || !IsValidOrder(order) || IsTraitDisabled)
return;
if (!CanInfiltrateTarget(self, order.Target))

View File

@@ -360,7 +360,7 @@ namespace OpenRA.Mods.Cnc.Traits
public bool TargetOverridesSelection(Actor self, in Target target, List<Actor> actorsAt, CPos xy, TargetModifiers modifiers) { return true; }
public bool CanTarget(Actor self, in Target target, List<Actor> othersAtTarget, ref TargetModifiers modifiers, ref string cursor)
public bool CanTarget(Actor self, in Target target, ref TargetModifiers modifiers, ref string cursor)
{
if (target.Type != TargetType.Terrain)
return false;

View File

@@ -178,7 +178,7 @@ namespace OpenRA.Mods.Cnc.Traits
public bool IsQueued { get; protected set; }
public bool TargetOverridesSelection(Actor self, in Target target, List<Actor> actorsAt, CPos xy, TargetModifiers modifiers) { return true; }
public bool CanTarget(Actor self, in Target target, List<Actor> othersAtTarget, ref TargetModifiers modifiers, ref string cursor)
public bool CanTarget(Actor self, in Target target, ref TargetModifiers modifiers, ref string cursor)
{
if (modifiers.HasModifier(TargetModifiers.ForceMove))
{

View File

@@ -70,7 +70,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
IEnumerable<IRenderable> IRender.Render(Actor self, WorldRenderer wr)
{
var bodyOrientation = body.QuantizeOrientation(self, self.Orientation);
var bodyOrientation = body.QuantizeOrientation(self.Orientation);
var pos = self.CenterPosition;
var i = 0;

View File

@@ -60,7 +60,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
.FirstOrDefault(t => t.EnabledByDefault);
if (renderSprites != null && infantryBody != null)
{
disguiseImage = renderSprites.GetImage(disguiseActor, self.World.Map.Rules.Sequences, disguisePlayer.Faction.InternalName);
disguiseImage = renderSprites.GetImage(disguiseActor, disguisePlayer.Faction.InternalName);
disguiseInfantryBody = infantryBody;
}
}

View File

@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
overlay.Play(info.Sequence);
WithOffset = new AnimationWithOffset(overlay,
() => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))),
() => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self.Orientation))),
() => !Visible || IsTraitDisabled);
rs.Add(WithOffset, info.Palette, info.IsPlayerPalette);

View File

@@ -59,7 +59,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
var idleModel = self.World.ModelCache.GetModelSequence(rv.Image, info.IdleSequence);
modelAnimation = new ModelAnimation(idleModel, () => WVec.Zero,
() => body.QuantizeOrientation(self, self.Orientation),
() => body.QuantizeOrientation(self.Orientation),
() => Docked,
() => 0, info.ShowShadow);
@@ -67,7 +67,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
var unloadModel = self.World.ModelCache.GetModelSequence(rv.Image, info.UnloadSequence);
rv.Add(new ModelAnimation(unloadModel, () => WVec.Zero,
() => body.QuantizeOrientation(self, self.Orientation),
() => body.QuantizeOrientation(self.Orientation),
() => !Docked,
() => 0, info.ShowShadow));
}

View File

@@ -64,7 +64,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
var model = self.World.ModelCache.GetModelSequence(rv.Image, info.Sequence);
frames = model.Frames;
modelAnimation = new ModelAnimation(model, () => WVec.Zero,
() => body.QuantizeOrientation(self, self.Orientation),
() => body.QuantizeOrientation(self.Orientation),
() => IsTraitDisabled, () => frame, info.ShowShadow);
rv.Add(modelAnimation);

View File

@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Cnc.Traits
[Desc("How often the cash ticks can appear.")]
public readonly int TickRate = 10;
public override object Create(ActorInitializer init) { return new ResourcePurifier(init.Self, this); }
public override object Create(ActorInitializer init) { return new ResourcePurifier(this); }
}
public class ResourcePurifier : ConditionalTrait<ResourcePurifierInfo>, INotifyResourceAccepted, ITick, INotifyOwnerChanged
@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Cnc.Traits
int currentDisplayTick;
int currentDisplayValue;
public ResourcePurifier(Actor self, ResourcePurifierInfo info)
public ResourcePurifier(ResourcePurifierInfo info)
: base(info)
{
modifier = new int[] { Info.Modifier };

View File

@@ -70,13 +70,13 @@ namespace OpenRA.Mods.Cnc.Traits
return new DischargeableSupportPowerInstance(key, info, manager);
}
public void Activate(Actor self, SupportPowerInstance instance)
public void Activate(Actor self)
{
active = true;
techTree.ActorChanged(self);
}
public void Deactivate(Actor self, SupportPowerInstance instance)
public void Deactivate(Actor self)
{
active = false;
techTree.ActorChanged(self);
@@ -119,7 +119,7 @@ namespace OpenRA.Mods.Cnc.Traits
available = false;
foreach (var p in Instances)
((GrantPrerequisiteChargeDrainPower)p).Deactivate(p.Self, this);
((GrantPrerequisiteChargeDrainPower)p).Deactivate(p.Self);
}
public override void Tick()
@@ -178,7 +178,7 @@ namespace OpenRA.Mods.Cnc.Traits
power.PlayLaunchSounds();
foreach (var p in Instances)
((GrantPrerequisiteChargeDrainPower)p).Activate(p.Self, this);
((GrantPrerequisiteChargeDrainPower)p).Activate(p.Self);
}
public override string IconOverlayTextOverride()

View File

@@ -47,7 +47,7 @@ namespace OpenRA.Mods.Cnc.Traits
return;
var external = toActor.TraitsImplementing<ExternalCondition>()
.FirstOrDefault(t => t.Info.Condition == info.Condition && t.CanGrantCondition(toActor, this));
.FirstOrDefault(t => t.Info.Condition == info.Condition && t.CanGrantCondition(this));
external?.GrantCondition(toActor, this, duration, remaining);
}

View File

@@ -239,7 +239,7 @@ namespace OpenRA.Mods.Cnc.UtilityCommands
public override void ReadActors(IniFile file)
{
base.ReadActors(file);
LoadActors(file, "SHIPS", Players, MapSize, Map);
LoadActors(file, "SHIPS", Players, Map);
}
public override void SaveWaypoint(int waypointNumber, ActorReference waypointReference)