Class SitAction
A sit action is an action in which someone perpetually sits on an object while the action is being executed. This action is the base class used for SitToilet's action class. Note that, for desk object interactions and interactions with movable held items, WorkAtDeskObjectBehavior or GetAndSitDownBehavior should be used instead.
public class SitAction : MultiAction, IGenericDataHolder
- Inheritance
-
JsonTypeSafeGenericDataHolderSitAction
- Implements
-
IGenericDataHolder
- Inherited Members
-
JsonTypeSafeGenericDataHolder.GetDataKeys()
- Extension Methods
Constructors
SitAction(ActionType, ActionInfo)
Creates a new action with the given action information.
public SitAction(ActionType type, ActionInfo info)
Parameters
type
ActionTypeThe type for this action.
info
ActionInfoThe information for this action.
Methods
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
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
CanMultitask(Action)
Return true on this method if this action can be multi-tasked along with the passed Action. To actually check this property, CanMultitask(Action, Action) should be used as it compares both objects. A multi-tasking is an action that is currently active along with another action. By default, multi-tasking is disallowed for any action.
public override bool CanMultitask(Action other)
Parameters
other
ActionThe action to multi-task with
Returns
- bool
Whether this action can be multi-tasked
CreateFirstActions()
Return a set of actions that should be executed before this action. Even if the yield statement is used, all actions will be collected into a list at the start of this action's invocation. If no action gets returned in this function, this action fails. If the returned set only contains null items, no first actions will be executed.
protected override IEnumerable<Action> CreateFirstActions()
Returns
- IEnumerable<Action>
A set of actions that should run before this action