Begin to unhack unit movement/cursors; Flying units no longer show move-blocked cursor on water

This commit is contained in:
Paul Chote
2009-12-21 03:09:47 -08:00
parent 7fa1da0d7d
commit 7aea135113
9 changed files with 46 additions and 15 deletions

View File

@@ -5,7 +5,7 @@ using OpenRa.Game.GameRules;
namespace OpenRa.Game.Traits
{
class Mobile : IOrder, IOccupySpace
class Mobile : IOrder, IOccupySpace, IMovement
{
readonly Actor self;
@@ -74,11 +74,16 @@ namespace OpenRa.Game.Traits
case "Ship":
return UnitMovementType.Float;
case "Plane":
return UnitMovementType.Track; // FIXME: remove this when planes actually fly.
return UnitMovementType.Fly;
default:
throw new InvalidOperationException("GetMovementType on unit that shouldn't be aable to move.");
}
}
public bool CanEnterCell(int2 location)
{
return Game.IsCellBuildable( location, GetMovementType(), self );
}
public IEnumerable<int2> GetCurrentPath()
{