Struct AchievementConditionProgress
How far along a condition is: the numerator and denominator to show, plus the 0..1 fraction
they represent. Immutable value object.
Assembly: Serenity.Achievements.Application.dll
Syntax
public readonly struct AchievementConditionProgress : IEquatable<AchievementConditionProgress>
Constructors
AchievementConditionProgress(long, long)
Creates a progress whose fraction is the ratio of the two counts.
Declaration
public AchievementConditionProgress(long current, long target)
Parameters
| Type |
Name |
Description |
| long |
current |
How much is done. Negative values are clamped to zero.
|
| long |
target |
How much is asked for. Zero means the requirement is already met.
|
AchievementConditionProgress(long, long, float)
Creates a progress carrying an explicitly measured fraction.
Declaration
public AchievementConditionProgress(long current, long target, float normalized)
Parameters
| Type |
Name |
Description |
| long |
current |
How much is done. Negative values are clamped to zero.
|
| long |
target |
How much is asked for. Negative values are clamped to zero.
|
| float |
normalized |
The 0..1 fraction. Values outside that range are clamped.
|
Fields
Current
How much of the requirement is done. Never negative.
Declaration
public readonly long Current
Field Value
Normalized
The same progress as a 0..1 fraction.
Declaration
public readonly float Normalized
Field Value
Target
How much the requirement asks for. Never negative.
Declaration
public readonly long Target
Field Value
Properties
IsComplete
Whether the requirement has been reached.
Declaration
public bool IsComplete { get; }
Property Value
Methods
Boolean(bool)
The progress of a condition that is either done or not, with no middle.
Declaration
public static AchievementConditionProgress Boolean(bool isMet)
Parameters
| Type |
Name |
Description |
| bool |
isMet |
Whether the condition is satisfied.
|
Returns
Equals(AchievementConditionProgress)
Declaration
public bool Equals(AchievementConditionProgress other)
Parameters
Returns
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| object |
obj |
|
Returns
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
ToString()
Declaration
public override string ToString()
Returns
Overrides
Operators
operator ==(AchievementConditionProgress, AchievementConditionProgress)
Declaration
public static bool operator ==(AchievementConditionProgress left, AchievementConditionProgress right)
Parameters
Returns
operator !=(AchievementConditionProgress, AchievementConditionProgress)
Declaration
public static bool operator !=(AchievementConditionProgress left, AchievementConditionProgress right)
Parameters
Returns
Implements