SitAction - Ellpeck/TinyLifeExampleMod Wiki
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 TinyLife.Actions.ActionType.SitToilet's action class.
Note that, for desk object interactions and interactions with movable held items, WorkAtDeskObjectAction or GetAndSitDownAction should be used instead.
public class SitAction : TinyLife.Actions.MultiAction
SitAction.SitAction(ActionType, ActionInfo) Constructor
Creates a new action from the given ActionType
public SitAction(TinyLife.Actions.ActionType type, TinyLife.Actions.ActionInfo info);
The type to create this action from
The information for this action
Initializes the main action.
This method is called after FirstActions have all completed.
protected override void AndThenInitialize();
MultiAction version of IsCompleted().
This method returns whether or not the main action is completed.
protected override TinyLife.Actions.Action.CompletionType AndThenIsCompleted();
Whether the main action is completed
SitAction.AndThenUpdate(GameTime, TimeSpan, GameSpeed) Method
protected override void AndThenUpdate(Microsoft.Xna.Framework.GameTime time, System.TimeSpan passedInGame, TinyLife.GameSpeed speed);
The current game time
The amount of time that has passed, in game time
The game's speed
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(TinyLife.Actions.Action other);
The action to multi-task with
Whether this action can be multi-tasked
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 a null action is returned as the first item, no first actions will be executed.
protected override System.Collections.Generic.IEnumerable<TinyLife.Actions.Action> CreateFirstActions();