Restructuring orders.
This commit is contained in:
27
OpenRa.Game/Traits/Activities/DeployMcv.cs
Executable file
27
OpenRa.Game/Traits/Activities/DeployMcv.cs
Executable file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenRa.Game.Traits.Activities
|
||||
{
|
||||
class DeployMcv : Mobile.CurrentActivity
|
||||
{
|
||||
public Mobile.CurrentActivity NextActivity { get; set; }
|
||||
|
||||
public void Tick( Actor self, Mobile mobile )
|
||||
{
|
||||
Game.world.AddFrameEndTask( _ =>
|
||||
{
|
||||
Game.world.Remove( self );
|
||||
Game.world.Add( new Actor( "fact", self.Location - new int2( 1, 1 ), self.Owner ) );
|
||||
} );
|
||||
}
|
||||
|
||||
public void Cancel( Actor self, Mobile mobile )
|
||||
{
|
||||
// Cancel can't happen between this being moved to the head of the list, and it being Ticked.
|
||||
throw new InvalidOperationException( "DeployMcvAction: Cancel() should never occur." );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user