Table of Contents

Class SimpleBehaviorAction

Namespace
TinyLife.Actions
Assembly
Tiny Life.dll

A simple behavior action is a BehaviorAction that can be constructed simply without requiring a custom class that extends BehaviorAction. It does this through the Create(ActionSettings) method, similarly to TalkAction.

public class SimpleBehaviorAction : BehaviorAction<ActionBehavior>, IGenericDataHolder
Inheritance
JsonTypeSafeGenericDataHolder
SimpleBehaviorAction
Implements
IGenericDataHolder
Inherited Members
JsonTypeSafeGenericDataHolder.GetDataKeys()
Extension Methods

Constructors

SimpleBehaviorAction(ActionType, ActionInfo)

public SimpleBehaviorAction(ActionType type, ActionInfo info)

Parameters

type ActionType
info ActionInfo

Properties

Settings

The underlying SimpleBehaviorAction.ActionSettings for this simple behavior action instance.

public SimpleBehaviorAction.ActionSettings Settings { get; }

Property Value

SimpleBehaviorAction.ActionSettings

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

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

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 Action

The action to multi-task with

Returns

bool

Whether this action can be multi-tasked

Create(ActionSettings)

Creates a new set of type settings that uses the SimpleBehaviorAction underlying action type, with the given settings. A part of this method, the ActionType.TypeSettings's CanExecute delegate is extended with the DisallowedEmotions.

public static ActionType.TypeSettings Create(SimpleBehaviorAction.ActionSettings settings)

Parameters

settings SimpleBehaviorAction.ActionSettings

The settings to use for construction.

Returns

ActionType.TypeSettings

A set of ActionType.TypeSettings to use for registering.