Class TimedGoal
A timed goal is an auto-triggered goal, intended to be used with AutoGoalInfo, that gets completed when a specified amount of time is reached. To trigger all timed goals in a goal set, use Trigger(TimeSpan).
public class TimedGoal : AutoTriggerGoal<TimeSpan>, IGenericDataHolder
- Inheritance
-
JsonTypeSafeGenericDataHolderTimedGoal
- Implements
-
IGenericDataHolder
- Inherited Members
-
JsonTypeSafeGenericDataHolder.GetDataKeys()
- Extension Methods
Constructors
TimedGoal(GoalSet, AutoGoalInfo)
public TimedGoal(GoalSet set, AutoGoalInfo info)
Parameters
set
GoalSetinfo
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(TimeSpan)
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(TimeSpan value)
Parameters
value
TimeSpanThe value to trigger.