Class AutoTriggerGoal
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
-
JsonTypeSafeGenericDataHolderAutoTriggerGoal
- Implements
-
IGenericDataHolder
- Derived
- Inherited Members
-
JsonTypeSafeGenericDataHolder.GetDataKeys()
- Extension Methods
Constructors
AutoTriggerGoal(GoalSet, AutoGoalInfo)
protected AutoTriggerGoal(GoalSet set, AutoGoalInfo info)
Parameters
set
GoalSetinfo
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
objectThe object that is triggering this goal.
trigger
GoalTriggerThe type of goal trigger that is triggering this goal.
value
objectThe 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
objectThe value to trigger.