Table of Contents

Struct SimpleBehaviorAction.ActionSettings

Namespace
TinyLife.Actions
Assembly
Tiny Life.dll

A struct used by SimpleBehaviorAction's Create(ActionSettings) method to pass settings onto a simple behavior action.

public struct SimpleBehaviorAction.ActionSettings
Inherited Members
Extension Methods

Constructors

ActionSettings(string, ObjectCategory)

Creates a new set of action settings with the given defaults.

public ActionSettings(string name, ObjectCategory context)

Parameters

name string

The name of the action to pass to the ActionType.TypeSettings constructor.

context ObjectCategory

The context to pass to the ActionType.TypeSettings constructor.

Fields

AllowMultitasking

A function that determines whether multitasking is allowed. The arguments passed are the instance of the simple behavior action, as well as the two arguments passed to CanMultitask(Action). If this is null, the base implementation is used in CanMultitask(Action).

public Func<SimpleBehaviorAction, Action, bool> AllowMultitasking

Field Value

Func<SimpleBehaviorAction, Action, bool>

CompletionTime

public required TimeSpan CompletionTime

Field Value

TimeSpan

ConstructBehavior

A function that constructs the behavior for this simple behavior action.

public required Func<SimpleBehaviorAction, ActionBehavior> ConstructBehavior

Field Value

Func<SimpleBehaviorAction, ActionBehavior>

DisallowedEmotions

A set of emotions that will cancel the simple behavior action, and that will cause new instances of the action not to be constructable.

public EmotionType[] DisallowedEmotions

Field Value

EmotionType[]

EfficiencyMattersCompletion

Whether efficiency matters for this action settings' CompletionTime. This is passed to CompleteIfTimeUp(TimeSpan, bool, SkillType, float, bool).

public bool EfficiencyMattersCompletion

Field Value

bool

GainedSkill

A skill that is optionally gained in AndThenUpdate(GameTime, TimeSpan, float), where the amount is multiplied with the passed in-game time.

public (SkillType Type, float Amount) GainedSkill

Field Value

(SkillType Type, float Amount)

OnCompleted

An action that is invoked when an instance of the simple behavior action is completed, in AndThenOnCompleted(CompletionType).

public Action<SimpleBehaviorAction, CompletionType> OnCompleted

Field Value

Action<SimpleBehaviorAction, CompletionType>

RestoredNeeds

A a set of needs that are optionally restored in AndThenUpdate(GameTime, TimeSpan, float), where the restoration amounts are multiplied with the passed in-game time.

public (NeedType Type, float Amount)[] RestoredNeeds

Field Value

(NeedType Need, float Modifier)[]

Settings

A set of ActionType.TypeSettings that should be used. These will be amended with additional info based on these action settings in Create(ActionSettings).

public ActionType.TypeSettings Settings

Field Value

ActionType.TypeSettings