Table of Contents

Class WalkAction

Namespace
TinyLife.Actions
Assembly
Tiny Life.dll

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
JsonTypeSafeGenericDataHolder
WalkAction
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 ActionInfo

The information for this action.

Fields

DrainEnergy

A field that determines whether this walk action should drain the underlying Person's Energy need. By default, this value is set to true.

[DataMember]
public bool DrainEnergy

Field Value

bool

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

Task<Stack<(Vector2 Pos, float Floor)>>

A task that, when finished, returns a path

GetSpeed()

Returns the speed that the Person 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)

Parameters

time GameTime

The current game time

passedInGame TimeSpan

The amount of time that has passed, in game time

speedMultiplier float

The game speed multiplier, which represents how fast things should happen, which is usually determined by Speed