Class WalkAction
A walk action is the action that gets executed by GoHere if the distance is short enough, or before and after driving part of the way to the action location.
public class WalkAction : PathfindAction, IGenericDataHolder
- Inheritance
-
JsonTypeSafeGenericDataHolderWalkAction
- Implements
-
IGenericDataHolder
- Inherited Members
-
JsonTypeSafeGenericDataHolder.GetDataKeys()
- Extension Methods
Constructors
WalkAction(ActionInfo)
Creates a new typeless action with the given action information.
public WalkAction(ActionInfo info)
Parameters
info
ActionInfoThe information for this action.
Fields
DrainEnergy
A field that determines whether this walk action should drain the underlying PersonLike's Energy need. By default, this value is set to true.
[DataMember]
public bool DrainEnergy
Field Value
Methods
FindPath(ICollection<(Point Pos, int Floor)>)
A method called by Initialize() to start finding a path to the given goal location.
protected override Task<Stack<(Vector2 Pos, float Floor)>> FindPath(ICollection<(Point Pos, int Floor)> goals)
Parameters
goals
ICollection<(Point Pos, int Floor)>The goal locations
Returns
GetSpeed()
Returns the speed that the PersonLike should traverse with.
protected override float GetSpeed()
Returns
- float
The speed
Update(GameTime, TimeSpan, float)
This method is called every update frame if this action is currently active. By default, only the ElapsedTime is modified in this method and ActionUpdate(Action, GameTime, TimeSpan, float, bool) is called.
public override void Update(GameTime time, TimeSpan passedInGame, float speedMultiplier)