Split AircraftMoveOrderTargeter to its own file
This commit is contained in:
@@ -372,36 +372,4 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class AircraftMoveOrderTargeter : IOrderTargeter
|
||||
{
|
||||
public string OrderID { get { return "Move"; } }
|
||||
public int OrderPriority { get { return 4; } }
|
||||
public bool OverrideSelection { get { return false; } }
|
||||
|
||||
readonly AircraftInfo info;
|
||||
|
||||
public AircraftMoveOrderTargeter(AircraftInfo info) { this.info = info; }
|
||||
|
||||
public bool CanTarget(Actor self, Target target, List<Actor> othersAtTarget, TargetModifiers modifiers, ref string cursor)
|
||||
{
|
||||
if (target.Type != TargetType.Terrain)
|
||||
return false;
|
||||
|
||||
var location = self.World.Map.CellContaining(target.CenterPosition);
|
||||
var explored = self.Owner.Shroud.IsExplored(location);
|
||||
cursor = self.World.Map.Contains(location) ?
|
||||
(self.World.Map.GetTerrainInfo(location).CustomCursor ?? "move") :
|
||||
"move-blocked";
|
||||
|
||||
IsQueued = modifiers.HasModifier(TargetModifiers.ForceQueue);
|
||||
|
||||
if (!explored && !info.MoveIntoShroud)
|
||||
cursor = "move-blocked";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool IsQueued { get; protected set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user