Add plumbing for notifying traits of movement
More precisely, about start and stop of movement.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user