GoHereAction - Ellpeck/TinyLifeExampleMod Wiki
A go here action is an action that uses two underlying actions for its execution: an action where a person walks to a goal and an action where a person drives to a goal.
This is the action class used by TinyLife.Actions.ActionType.GoHere.
public class GoHereAction : TinyLife.Actions.MultiAction
GoHereAction.GoHereAction(ActionType, ActionInfo) Constructor
Creates a new action from the given ActionType
public GoHereAction(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
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(TinyLife.Actions.Action cancelSource);
The source of the cancelation, or null if the player canceled it
true if the action can be canceled
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();
GoHereAction.ShouldFail(Action, CompletionType) Method
A method that returns whether or not this main action should fail if the previous or next completedAction completed with the given completion.
By default, this method returns true only if completion is not Completed.
protected override bool ShouldFail(TinyLife.Actions.Action completedAction, TinyLife.Actions.Action.CompletionType completion);
The action that has completed
The completion type of the action
true if we should fail due to this completion