Use in parameter for Target
This commit is contained in:
@@ -31,13 +31,13 @@ namespace OpenRA.Mods.Common.Activities
|
||||
bool useLastVisibleTarget;
|
||||
readonly List<WPos> positionBuffer = new List<WPos>();
|
||||
|
||||
public Fly(Actor self, Target t, WDist nearEnough, WPos? initialTargetPosition = null, Color? targetLineColor = null)
|
||||
public Fly(Actor self, in Target t, WDist nearEnough, WPos? initialTargetPosition = null, Color? targetLineColor = null)
|
||||
: this(self, t, initialTargetPosition, targetLineColor)
|
||||
{
|
||||
this.nearEnough = nearEnough;
|
||||
}
|
||||
|
||||
public Fly(Actor self, Target t, WPos? initialTargetPosition = null, Color? targetLineColor = null)
|
||||
public Fly(Actor self, in Target t, WPos? initialTargetPosition = null, Color? targetLineColor = null)
|
||||
{
|
||||
aircraft = self.Trait<Aircraft>();
|
||||
target = t;
|
||||
@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
lastVisibleTarget = Target.FromPos(initialTargetPosition.Value);
|
||||
}
|
||||
|
||||
public Fly(Actor self, Target t, WDist minRange, WDist maxRange,
|
||||
public Fly(Actor self, in Target t, WDist minRange, WDist maxRange,
|
||||
WPos? initialTargetPosition = null, Color? targetLineColor = null)
|
||||
: this(self, t, initialTargetPosition, targetLineColor)
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
bool hasTicked;
|
||||
bool returnToBase;
|
||||
|
||||
public FlyAttack(Actor self, AttackSource source, Target target, bool forceAttack, Color? targetLineColor)
|
||||
public FlyAttack(Actor self, AttackSource source, in Target target, bool forceAttack, Color? targetLineColor)
|
||||
{
|
||||
this.source = source;
|
||||
this.target = target;
|
||||
@@ -211,7 +211,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
WDist exitRange;
|
||||
bool targetIsVisibleActor;
|
||||
|
||||
public FlyAttackRun(Actor self, Target t, WDist exitRange)
|
||||
public FlyAttackRun(Actor self, in Target t, WDist exitRange)
|
||||
{
|
||||
ChildHasPriority = false;
|
||||
|
||||
@@ -254,7 +254,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
WDist exitRange;
|
||||
readonly AttackAircraft attackAircraft;
|
||||
|
||||
public StrafeAttackRun(Actor self, AttackAircraft attackAircraft, Target t, WDist exitRange)
|
||||
public StrafeAttackRun(Actor self, AttackAircraft attackAircraft, in Target t, WDist exitRange)
|
||||
{
|
||||
ChildHasPriority = false;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
bool useLastVisibleTarget;
|
||||
bool wasMovingWithinRange;
|
||||
|
||||
public FlyFollow(Actor self, Target target, WDist minRange, WDist maxRange,
|
||||
public FlyFollow(Actor self, in Target target, WDist minRange, WDist maxRange,
|
||||
WPos? initialTargetPosition, Color? targetLineColor = null)
|
||||
{
|
||||
this.target = target;
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
this.endingDelay = endingDelay;
|
||||
}
|
||||
|
||||
public FlyOffMap(Actor self, Target target, int endingDelay = 25)
|
||||
public FlyOffMap(Actor self, in Target target, int endingDelay = 25)
|
||||
: this(self, endingDelay)
|
||||
{
|
||||
this.target = target;
|
||||
|
||||
@@ -40,16 +40,16 @@ namespace OpenRA.Mods.Common.Activities
|
||||
assignTargetOnFirstRun = true;
|
||||
}
|
||||
|
||||
public Land(Actor self, Target target, WAngle? facing = null, Color? targetLineColor = null)
|
||||
public Land(Actor self, in Target target, WAngle? facing = null, Color? targetLineColor = null)
|
||||
: this(self, target, new WDist(-1), WVec.Zero, facing, targetLineColor: targetLineColor) { }
|
||||
|
||||
public Land(Actor self, Target target, WDist landRange, WAngle? facing = null, Color? targetLineColor = null)
|
||||
public Land(Actor self, in Target target, WDist landRange, WAngle? facing = null, Color? targetLineColor = null)
|
||||
: this(self, target, landRange, WVec.Zero, facing, targetLineColor: targetLineColor) { }
|
||||
|
||||
public Land(Actor self, Target target, WVec offset, WAngle? facing = null, Color? targetLineColor = null)
|
||||
public Land(Actor self, in Target target, WVec offset, WAngle? facing = null, Color? targetLineColor = null)
|
||||
: this(self, target, WDist.Zero, offset, facing, targetLineColor: targetLineColor) { }
|
||||
|
||||
public Land(Actor self, Target target, WDist landRange, WVec offset, WAngle? facing = null, CPos[] clearCells = null, Color? targetLineColor = null)
|
||||
public Land(Actor self, in Target target, WDist landRange, WVec offset, WAngle? facing = null, CPos[] clearCells = null, Color? targetLineColor = null)
|
||||
{
|
||||
aircraft = self.Trait<Aircraft>();
|
||||
this.target = target;
|
||||
|
||||
Reference in New Issue
Block a user