Table of Contents

Class ConditionedGoal

Namespace
TinyLife.Goals
Assembly
Tiny Life.dll

A conditioned goal is an auto-triggered goal, intended to be used with AutoGoalInfo, that gets completed when a specified condition is met a single time. To trigger all conditioned goals in a goal set, use Trigger(bool).

public class ConditionedGoal : AutoTriggerGoal<bool>, IGenericDataHolder
Inheritance
JsonTypeSafeGenericDataHolder
ConditionedGoal
Implements
IGenericDataHolder
Inherited Members
JsonTypeSafeGenericDataHolder.GetDataKeys()
Extension Methods

Constructors

ConditionedGoal(GoalSet, AutoGoalInfo)

public ConditionedGoal(GoalSet set, AutoGoalInfo info)

Parameters

set GoalSet
info AutoGoalInfo

Methods

GetDisplayedProgress(bool)

Returns a string that is used in a goal set's displayed ui information that determines the progress of this goal. By default, the GetProgress() percentage is displayed as a percentage between 0 and 100.

public override string GetDisplayedProgress(bool reduced)

Parameters

reduced bool

Returns

string

The displayed goal progress

GetProgress()

Returns the progress percentage (between 0 and 1) that this goal has

public override float GetProgress()

Returns

float

The progress percentage

Reset()

Resets this goal to the default values, which should cause 0 to be returned on GetProgress()

public override void Reset()

Trigger(bool)

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

public override void Trigger(bool value)

Parameters

value bool

The value to trigger.