Table of Contents

Class OrderFromStaffAction

Namespace
TinyLife.Actions
Assembly
Tiny Life.dll

An abstract action class that allows creating actions where a Person orders a given item from a LotEmployment employee. This action expects the employee to then execute an action that leaves them with an item in their hand that can be passed to the one who submitted the order.

public abstract class OrderFromStaffAction : SocialAction, IGenericDataHolder
Inheritance
JsonTypeSafeGenericDataHolder
OrderFromStaffAction
Implements
IGenericDataHolder
Inherited Members
JsonTypeSafeGenericDataHolder.GetDataKeys()
Extension Methods

Constructors

OrderFromStaffAction(ActionInfo)

Creates a new typeless action with the given action information.

protected OrderFromStaffAction(ActionInfo info)

Parameters

info ActionInfo

The information for this action.

OrderFromStaffAction(ActionType, ActionInfo)

Creates a new action with the given action information.

public OrderFromStaffAction(ActionType type, ActionInfo info)

Parameters

type ActionType

The type for this action.

info ActionInfo

The information for this action.

Properties

ImportantObject

The category of the object that the LotEmployment employee should find and walk to to prepare the order.

protected abstract ObjectCategory ImportantObject { get; }

Property Value

ObjectCategory

MaxDistanceFromObject

The maximum distance that the Person ordering should be able to stand away from the ImportantObject to do so.

protected virtual int MaxDistanceFromObject { get; }

Property Value

int

PickUpOrderAction

The action that the Person picking up the order should execute to pick it up and further interact with it. For food items, Eat should be returned.

protected abstract ActionType PickUpOrderAction { get; }

Property Value

ActionType

Methods

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

CreateFirstActions()

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 the returned set only contains null items, no first actions will be executed.

protected override IEnumerable<Action> CreateFirstActions()

Returns

IEnumerable<Action>

A set of actions that should run before this action

CreatePrepareAction(ActionInfo)

Returns the action that should be executed by the LotEmployment employee to prepare the order.

protected abstract Action CreatePrepareAction(ActionInfo importantObject)

Parameters

importantObject ActionInfo

The object found using the ImportantObject category.

Returns

Action

The action that should be executed by the employee.

GetNextAction(CompletionType)

Returns an action that should be queued up immediately after this action completes. The queued up action is immediately started in the slot that this action occupied. Can be null, and is null by default.

public override Action GetNextAction(CompletionType completion)

Parameters

completion CompletionType

The type that this action completed with

Returns

Action

The follow-up action

IsConversationCompleted()

SocialAction version of IsCompleted(). This method returns whether or not the conversation should be marked as completed. Note that this method is only called for the IsMain part of the conversation.

protected override CompletionType IsConversationCompleted()

Returns

CompletionType

Whether or not this conversation is completed

UpdateConversation(GameTime, TimeSpan, float)

SocialAction version of Update(GameTime, TimeSpan, float). This method is called every update frame during an active conversation for both conversation partners. By default, this method only increases ConversationTime.

protected override void UpdateConversation(GameTime time, TimeSpan passedInGame, float speedMultiplier)

Parameters

time GameTime

The game's time

passedInGame TimeSpan

The amount of time passed in game time

speedMultiplier float

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