Table of Contents

Class WorkAtDeskObjectBehavior

Namespace
TinyLife.Actions.Behaviors
Assembly
Tiny Life.dll

A work at desk object behavior is a ActionBehavior where a person works at an object that is statically attached to a table or standing desk. Note that this behavior differs from GetAndSitDownBehavior in that the object involved in this behavior cannot be picked up or moved by a person. This class is used by ComputerBehavior.

public class WorkAtDeskObjectBehavior : ActionBehavior
Inheritance
WorkAtDeskObjectBehavior
Derived
Inherited Members
Extension Methods

Constructors

WorkAtDeskObjectBehavior(Action)

Creates a new work at desk object behavior with the given settings.

public WorkAtDeskObjectBehavior(Action action)

Parameters

action Action

The action that this behavior is acting upon.

WorkAtDeskObjectBehavior(Action, TimeSpan, TimeSpan)

Creates a new work at desk object behavior with the given settings.

public WorkAtDeskObjectBehavior(Action action, TimeSpan workTime, TimeSpan breakTime)

Parameters

action Action

The action that this behavior is acting upon.

workTime TimeSpan

The amount of in-game time that this action's PersonLike shoud look to be working for.

breakTime TimeSpan

The amount of in-game time that this action's PersonLike should look to be waiting for inbetween working sessions.

Properties

IsWorking

Returns whether this action's PersonLike currently looks to be working, which is displayed by the person's Pose being changed in Update(GameTime, TimeSpan, float).

protected bool IsWorking { get; }

Property Value

bool

Methods

CreateFirstActions()

Creates a set of actions that should be executed before the main Action starts. This method is automatically called when using BehaviorAction in CreateFirstActions().

public override IEnumerable<Action> CreateFirstActions()

Returns

IEnumerable<Action>

GetNextAction(CompletionType)

Returns the action that should be executed after this action behavior's underlying Action completes. This method is automatically called when using BehaviorAction in GetNextAction(CompletionType).

public override Action GetNextAction(CompletionType completion)

Parameters

completion CompletionType

The underlying action's completion type

Returns

Action

The action that should be executed next, or null

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