Table of Contents

Class DiscardHeldItemAction

Namespace
TinyLife.Actions
Assembly
TinyLife.dll

A typeless action that can be used to make tinies get rid of the item that they're currently holding before starting their action. To add custom default ways of discarding an item, they can be added to the DiscardActions collection.

public class DiscardHeldItemAction : DeferredAction, IGenericDataHolder
Inheritance
JsonTypeSafeGenericDataHolder
DiscardHeldItemAction
Implements
IGenericDataHolder
Inherited Members
JsonTypeSafeGenericDataHolder.GetDataKeys()
Extension Methods

Constructors

DiscardHeldItemAction(PersonLike)

public DiscardHeldItemAction(PersonLike person)

Parameters

person PersonLike

Fields

DiscardActions

The collection of default ways that a tiny will try to discard the item they're currently holding. The collection is ordered by "priority", so items closer to the start will be attempted first. By default, the last item in the collection is the PutDown action, which will be tried as a sort of "last resort".

public static readonly List<(Func<PersonLike, MapObject, bool> Predicate, Func<PersonLike, MapObject, ActionType> DiscardAction)> DiscardActions

Field Value

List<(Func<PersonLike, MapObject, bool> Predicate, Func<PersonLike, MapObject, ActionType> DiscardAction)>

Methods

CreateAction()

Creates the action that this DeferredAction should execute. This method is called in Initialize().

protected override Action CreateAction()

Returns

Action

The action to execute.