Table of Contents

Class DebugAction

Namespace
TinyLife.Actions
Assembly
Tiny Life.dll

An abstract class that can be used to easily create debug-only actions that are available when ShowDebugActions is enabled. A debug action type should be created using Create(string, ObjectCategory, Type, CanExecuteDelegate).

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

Constructors

DebugAction(ActionType, ActionInfo)

Creates a new action with the given action information.

protected DebugAction(ActionType type, ActionInfo info)

Parameters

type ActionType

The type for this action.

info ActionInfo

The information for this action.

Methods

Create(string, ObjectCategory, Type, CanExecuteDelegate)

Creates type settings for a debug action with the given settings.

public static ActionType.TypeSettings Create(string name, ObjectCategory context, Type constructedType, ActionType.CanExecuteDelegate canExecute = null)

Parameters

name string

The name.

context ObjectCategory

The context.

constructedType Type

The type of action to construct.

canExecute ActionType.CanExecuteDelegate

A ActionType.CanExecuteDelegate that determines whether the action can be started.

Returns

ActionType.TypeSettings

The created type settings.

IsCompleted()

This method is called every update frame by a Person if this action is currently active to check if it should be stopped. If this returns a result other than Completed, OnCompleted(CompletionType) will be called and the action is stopped. By default, only ForceResult modifies the completion type, otherwise Active is returned.

public override CompletionType IsCompleted()

Returns

CompletionType

The current completion type of this action

OnCompleted(CompletionType)

This method is called when this action IsCompleted(), or if it is canceled from an outside source. Note that, if this method is called as a result of IsCompleted(), the CompletionType passed will be the same. By default, only OnActionCompleted(Action, CompletionType, bool) is called.

public override void OnCompleted(CompletionType type)

Parameters

type CompletionType

The type that this action completed with

Run()

Runs this debug action's behavior.

protected abstract void Run()