Add plumbing for notifying traits of movement

More precisely, about start and stop of movement.
This commit is contained in:
reaperrr
2018-08-26 13:49:23 +02:00
committed by Paul Chote
parent 32ab822786
commit a10af382b4
15 changed files with 102 additions and 84 deletions

View File

@@ -410,8 +410,7 @@ namespace OpenRA.Mods.Common.Traits
Activity VisualMove(Actor self, WPos fromPos, WPos toPos);
int EstimatedMoveDuration(Actor self, WPos fromPos, WPos toPos);
CPos NearestMoveableCell(CPos target);
bool IsMoving { get; set; }
bool IsMovingVertically { get; set; }
MovementType CurrentMovementTypes { get; set; }
bool CanEnterTargetNow(Actor self, Target target);
}
@@ -548,4 +547,19 @@ namespace OpenRA.Mods.Common.Traits
{
bool PreventMapSpawn(World world, ActorReference actorReference);
}
[Flags]
public enum MovementType
{
None = 0,
Horizontal = 1,
Vertical = 2,
Turn = 4
}
[RequireExplicitImplementation]
public interface INotifyMoving
{
void MovementTypeChanged(Actor self, MovementType type);
}
}