actually doesn't work right now, but that will change. git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@2050 993157c7-ee19-0410-b2c4-bb4e9862e678
59 lines
975 B
C#
59 lines
975 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace OpenRa.Game
|
|
{
|
|
abstract class Order
|
|
{
|
|
public abstract void Apply( Game game );
|
|
}
|
|
|
|
class MoveOrder : Order
|
|
{
|
|
public readonly Unit Unit;
|
|
public readonly int2 Destination;
|
|
|
|
public MoveOrder(Unit unit, int2 destination)
|
|
{
|
|
this.Unit = unit;
|
|
this.Destination = destination;
|
|
}
|
|
|
|
public override void Apply( Game game )
|
|
{
|
|
Unit.nextOrder = UnitMissions.Move( Unit, Destination );
|
|
}
|
|
}
|
|
|
|
class DeployMcvOrder : Order
|
|
{
|
|
Unit unit;
|
|
|
|
public DeployMcvOrder( Unit unit )
|
|
{
|
|
this.unit = unit;
|
|
}
|
|
|
|
public override void Apply( Game game )
|
|
{
|
|
unit.nextOrder = UnitMissions.Deploy( unit );
|
|
}
|
|
}
|
|
|
|
class HarvestOrder : Order
|
|
{
|
|
Unit unit;
|
|
|
|
public HarvestOrder( Unit unit )
|
|
{
|
|
this.unit = unit;
|
|
}
|
|
|
|
public override void Apply( Game game )
|
|
{
|
|
unit.nextOrder = UnitMissions.Harvest( unit );
|
|
}
|
|
}
|
|
}
|