Table of Contents

Class ReadBehavior

Namespace
TinyLife.Actions.Behaviors
Assembly
Tiny Life.dll

An action behavior that is used for any kind of action that involves reading a book or other type of media. A BehaviorAction<T> using this behavior will cause the Person to sit down after using the underlying PickUpOrSpawnBehavior behavior to pick up or spawn the book.

public class ReadBehavior : PickUpOrSpawnBehavior
Inheritance
ReadBehavior
Inherited Members
Extension Methods

Constructors

ReadBehavior(Action, Func<FurnitureType>, int[], Func<Furniture, bool>)

Creates a new pick up or spawn behavior with the given settings.

public ReadBehavior(Action action, Func<FurnitureType> itemToSpawn, int[] colorsToSpawn = null, Func<Furniture, bool> isValid = null)

Parameters

action Action

The action.

itemToSpawn Func<FurnitureType>

The item to spawn, or pick up.

colorsToSpawn int[]

The colors to spawn.

isValid Func<Furniture, bool>

Whether the item that we're trying to pick up is valid. If this is null, the item is checked against the itemToSpawn.

Exceptions

ArgumentNullException

Thrown if the itemToSpawn is null.

Properties

FullyInProgress

Returns whether this action behavior is fully in progress. This is the action behavior version of FullyInProgress.

public override bool FullyInProgress { get; }

Property Value

bool

Methods

CanMultitask(Action)

Return true on this method if this action can be multi-tasked along with the passed Action. 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

Initialize()

Initializes this action behavior. This method is automatically called when using BehaviorAction in AndThenInitialize().

public override void Initialize()

OnCompleted(CompletionType)

Causes any activities that this action behavior executes to be marked as completed. This method is automatically called when using BehaviorAction in OnCompleted(CompletionType).

public override void OnCompleted(CompletionType completion)

Parameters

completion CompletionType

Update(GameTime, TimeSpan, float)

Updates this action behavior every update frame. This method is automatically called when using BehaviorAction in AndThenUpdate(GameTime, TimeSpan, float).

public override void Update(GameTime time, TimeSpan passedInGame, float speedMultiplier)

Parameters

time GameTime

The game time

passedInGame TimeSpan

The amount of time that has passed since the last update frame

speedMultiplier float

The game speed multiplier, which represents how fast things should happen, which is usually determined by Speed