Table of Contents

Class AmountGoal

Namespace
TinyLife.Goals
Assembly
Tiny Life.dll

An amount goal is an auto-triggered goal, intended to be used with AutoGoalInfo, that keeps track of an amount of things that have been completed. To trigger all amount goals in a goal set, use Trigger(IGoalTriggerable, object, GoalTrigger, params object[]).

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

Constructors

AmountGoal(GoalSet, AutoGoalInfo)

public AmountGoal(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(float)

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(float value)

Parameters

value float

The value to trigger.