Implement DeployToUpgrade.

Expose some deploy-related cursors to yaml.
This commit is contained in:
Taryn Hill
2015-04-05 02:45:33 -05:00
parent 70c9bca847
commit 0717ca57ea
7 changed files with 133 additions and 9 deletions

View File

@@ -16,18 +16,18 @@ namespace OpenRA.Mods.Common.Orders
{
public class DeployOrderTargeter : IOrderTargeter
{
readonly Func<bool> useDeployCursor;
readonly Func<string> cursor;
public DeployOrderTargeter(string order, int priority)
: this(order, priority, () => true)
: this(order, priority, () => "deploy")
{
}
public DeployOrderTargeter(string order, int priority, Func<bool> useDeployCursor)
public DeployOrderTargeter(string order, int priority, Func<string> cursor)
{
this.OrderID = order;
this.OrderPriority = priority;
this.useDeployCursor = useDeployCursor;
this.cursor = cursor;
}
public string OrderID { get; private set; }
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Orders
return false;
IsQueued = modifiers.HasModifier(TargetModifiers.ForceQueue);
cursor = useDeployCursor() ? "deploy" : "deploy-blocked";
cursor = this.cursor();
return self == target.Actor;
}