Table of Contents

Class CollectTrashAction

Namespace
TinyLife.Actions
Assembly
TinyLife.dll
public class CollectTrashAction : MultiAction, IGenericDataHolder
Inheritance
JsonTypeSafeGenericDataHolder
CollectTrashAction
Implements
IGenericDataHolder
Inherited Members
JsonTypeSafeGenericDataHolder.GetDataKeys()
Extension Methods

Constructors

CollectTrashAction(ActionType, ActionInfo)

public CollectTrashAction(ActionType type, ActionInfo info)

Parameters

type ActionType
info ActionInfo

Fields

SpecialTrash

public static readonly List<(ObjectCategory Category, Func<Furniture, bool> Condition)> SpecialTrash

Field Value

List<(ObjectCategory Category, Func<Furniture, bool> Condition)>

Methods

AndThenInitialize()

Initializes the main action. This method is called after Handler has all completed.

protected override void AndThenInitialize()

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

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

GetNextTrashItem(Map, PersonLike)

public static Furniture GetNextTrashItem(Map map, PersonLike person)

Parameters

map Map
person PersonLike

Returns

Furniture

OnChildCompleted(Action, CompletionType, bool)

This method is invoked automatically when an action completes that is marked as this action's child. A child action is one started through a MultiActionHandler or UnderlyingActionHandler. By default, this method calls OnChildCompleted(Action, CompletionType, bool) on this action's Parent, if there is one.

protected override void OnChildCompleted(Action child, CompletionType type, bool grandchild)

Parameters

child Action

The child that completed.

type CompletionType

The child's completion type.

grandchild bool

Whether the given child is a grandchild, rather than a direct child.