Class WorkAction
A work action is the action that is used for Job instances when a person goes to work
public class WorkAction : OutOfTownAction, IGenericDataHolder
- Inheritance
-
JsonTypeSafeGenericDataHolderWorkAction
- Implements
-
IGenericDataHolder
- Inherited Members
-
JsonTypeSafeGenericDataHolder.GetDataKeys()
- Extension Methods
Constructors
WorkAction(ActionType, ActionInfo)
public WorkAction(ActionType type, ActionInfo info)
Parameters
type
ActionTypeinfo
ActionInfo
Properties
Job
The job that this work action is working at.
public Job Job { get; }
Property Value
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
CompletionTypeThe 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
GameTimeThe current game time
passedInGame
TimeSpanThe amount of time that has passed, in game time
speedMultiplier
floatThe 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
ActionThe 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()