SellAction - Ellpeck/TinyLifeExampleMod Wiki
A sell action is an action where an item that can be picked up gets sold at a mailbox.
Since this action can be invoked by clicking on the sold object, or by clicking on a mailbox while holding the sold object, GetSoldObject<T>(ActionInfo) should be used to return the correct object in both circumstances.
public class SellAction : TinyLife.Actions.MultiAction
Initializes the main action.
This method is called after FirstActions have all completed.
protected override void AndThenInitialize();
MultiAction version of IsCompleted().
This method returns whether or not the main action is completed.
protected override TinyLife.Actions.Action.CompletionType AndThenIsCompleted();
Whether the main action is completed
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 a null action is returned as the first item, no first actions will be executed.
protected override System.Collections.Generic.IEnumerable<TinyLife.Actions.Action> CreateFirstActions();
A helper method that returns the object that is being sold.
This method returns the action object or the person's held object.
public static T GetSoldObject<T>(TinyLife.Actions.ActionInfo info) where T : TinyLife.Objects.Furniture;
The type that the object is expected to be
The action info
The object, or null if there is none or it doesn't match the type