Table of Contents

Class WorkAction

Namespace
TinyLife.Actions
Assembly
Tiny Life.dll

A work action is the action that is used for Job instances when a person goes to work

public class WorkAction : OutOfTownAction, IGenericDataHolder
Inheritance
JsonTypeSafeGenericDataHolder
WorkAction
Implements
IGenericDataHolder
Inherited Members
JsonTypeSafeGenericDataHolder.GetDataKeys()
Extension Methods

Constructors

WorkAction(ActionType, ActionInfo)

public WorkAction(ActionType type, ActionInfo info)

Parameters

type ActionType
info ActionInfo

Properties

Job

The job that this work action is working at.

public Job Job { get; }

Property Value

Job

Methods

AndThenInitialize()

Initializes the main action. This method is called after Handler has all completed.

protected override void AndThenInitialize()

AndThenIsCompleted()

MultiAction version of IsCompleted(). This method returns whether or not the main action is completed.

protected override CompletionType AndThenIsCompleted()

Returns

CompletionType

Whether the main action is completed

AndThenOnCompleted(CompletionType)

MultiAction version of OnCompleted(CompletionType). This method gets called when the main action completes.

protected override void AndThenOnCompleted(CompletionType type)

Parameters

type CompletionType

The completion of the main action

AndThenUpdate(GameTime, TimeSpan, float)

MultiAction version of Update(GameTime, TimeSpan, float). This method is called every update frame while the main action is active. By default, only MainElapsedTime is increased.

protected override void AndThenUpdate(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

CanCancel(Action)

Returns whether or not this action can be canceled by the given outside source. Note that the outside source can be null, and if it is, it means that the player canceled the action manually. By default, actions can only be canceled if the cancelSource is null.

public override bool CanCancel(Action cancelSource)

Parameters

cancelSource Action

The source of the cancelation, or null if the player canceled it

Returns

bool

true if the action can be canceled

PreInitialize()

This method is called in Initialize() before CreateFirstActions() is called. By default, it does nothing.

protected override void PreInitialize()