more of attack-ground (order wiring, etc); doesn't work.
This commit is contained in:
@@ -70,6 +70,16 @@ namespace OpenRA.Traits.Activities
|
||||
this.nearEnough = range;
|
||||
}
|
||||
|
||||
public Move(Target target, int range)
|
||||
: this()
|
||||
{
|
||||
this.getPath = self => self.World.PathFinder.FindUnitPathToRange(
|
||||
self.Location, Util.CellContaining(target.CenterLocation),
|
||||
range, self);
|
||||
this.destination = null;
|
||||
this.nearEnough = range;
|
||||
}
|
||||
|
||||
public Move(Func<List<int2>> getPath)
|
||||
: this()
|
||||
{
|
||||
|
||||
@@ -165,6 +165,9 @@ namespace OpenRA.Traits
|
||||
|
||||
public static Target FromActor(Actor a) { return new Target { actor = a, valid = true }; }
|
||||
public static Target FromPos(float2 p) { return new Target { pos = p, valid = true }; }
|
||||
public static Target FromOrder(Order o) { return o.TargetActor != null ? Target.FromActor(o.TargetActor) : Target.FromPos(o.TargetLocation); }
|
||||
|
||||
public static readonly Target None = new Target();
|
||||
|
||||
public bool IsValid { get { return valid && (actor == null || actor.IsInWorld); } }
|
||||
public float2 CenterLocation { get { return actor != null ? actor.CenterLocation : pos; } }
|
||||
|
||||
Reference in New Issue
Block a user