Table of Contents

Class AutoTriggerGoal

Namespace
TinyLife.Goals
Assembly
Tiny Life.dll

An auto-triggered goal is intended to be used with AutoGoalInfo. This is the base class for all auto-triggered goals. Auto-triggered goals do not need to be called, triggered or referenced manually, since they get triggered automatically based on a GoalTrigger.

public abstract class AutoTriggerGoal : Goal<AutoGoalInfo>, IGenericDataHolder
Inheritance
JsonTypeSafeGenericDataHolder
AutoTriggerGoal
Implements
IGenericDataHolder
Derived
Inherited Members
JsonTypeSafeGenericDataHolder.GetDataKeys()
Extension Methods

Constructors

AutoTriggerGoal(GoalSet, AutoGoalInfo)

protected AutoTriggerGoal(GoalSet set, AutoGoalInfo info)

Parameters

set GoalSet
info AutoGoalInfo

Methods

CanTrigger(object, GoalTrigger, object)

Returns whether this auto-triggered goal can currently be triggered. If this method returns true, Trigger(object) should always cause a change in this goal.

public virtual bool CanTrigger(object obj, GoalTrigger trigger, object value)

Parameters

obj object

The object that is triggering this goal.

trigger GoalTrigger

The type of goal trigger that is triggering this goal.

value object

The value to trigger, which will be passed to Trigger(object).

Returns

bool

Whether this goal can be triggered right now.

Trigger(object)

Causes this auto-triggered goal to be triggered. This method should only be called if CanTrigger(object, GoalTrigger, object) returns true.

public abstract void Trigger(object value)

Parameters

value object

The value to trigger.