Add IIssueDeployOrder.

This commit is contained in:
Paul Chote
2017-06-03 15:46:31 +01:00
committed by Curtis Shmyr
parent 533b2f9ad7
commit e8d6d63707
6 changed files with 37 additions and 5 deletions

View File

@@ -60,7 +60,7 @@ namespace OpenRA.Mods.Common.Traits
public enum DeployState { Undeployed, Deploying, Deployed, Undeploying }
public class GrantConditionOnDeploy : IResolveOrder, IIssueOrder, INotifyCreated, INotifyDeployComplete
public class GrantConditionOnDeploy : IResolveOrder, IIssueOrder, INotifyCreated, INotifyDeployComplete, IIssueDeployOrder
{
readonly Actor self;
readonly GrantConditionOnDeployInfo info;
@@ -128,6 +128,11 @@ namespace OpenRA.Mods.Common.Traits
return null;
}
Order IIssueDeployOrder.IssueDeployOrder(Actor self)
{
return new Order("GrantConditionOnDeploy", self, false);
}
public void ResolveOrder(Actor self, Order order)
{
if (order.OrderString != "GrantConditionOnDeploy" || deployState == DeployState.Deploying || deployState == DeployState.Undeploying)