git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1285 993157c7-ee19-0410-b2c4-bb4e9862e678

This commit is contained in:
bob
2007-07-16 03:45:05 +00:00
parent ee8b3d82b9
commit 333a20d29e
10 changed files with 196 additions and 58 deletions

View File

@@ -4,17 +4,17 @@ using System.Text;
namespace OpenRa.Game
{
class MoveOrder
interface IOrder
{
void Apply();
}
class MoveOrder : IOrder
{
public readonly Mcv Unit;
public readonly float2 Destination;
public readonly int2 Destination;
public MoveOrder( Mcv unit, int x, int y )
: this( unit, new float2( x * 24, y * 24 ) )
{
}
public MoveOrder(Mcv unit, float2 destination)
public MoveOrder(Mcv unit, int2 destination)
{
this.Unit = unit;
this.Destination = destination;
@@ -22,7 +22,22 @@ namespace OpenRa.Game
public void Apply()
{
Unit.Accept( this );
Unit.AcceptMoveOrder( Destination );
}
}
class DeployMcvOrder : IOrder
{
public Mcv Unit;
public DeployMcvOrder( Mcv unit )
{
this.Unit = unit;
}
public void Apply()
{
Unit.AcceptDeployOrder();
}
}
}