Class VictoryRatingDef

Namespace
TDMaker.Core.Defs
Assembly
TDMaker.Core.dll

Immutable three-tier victory rating using the remaining/starting life ratio, with inclusive thresholds.

public sealed class VictoryRatingDef
Inheritance
VictoryRatingDef
Inherited Members

Constructors

VictoryRatingDef(float, float)

Creates authored life-ratio bands. Equal thresholds are allowed; the highest matching tier wins.

public VictoryRatingDef(float twoStarLifeRatio, float threeStarLifeRatio)

Parameters

twoStarLifeRatio float
threeStarLifeRatio float

Properties

ThreeStarLifeRatio

Minimum life ratio for three stars.

public float ThreeStarLifeRatio { get; }

Property Value

float

TwoStarLifeRatio

Minimum life ratio for two stars; lower positive ratios earn one star.

public float TwoStarLifeRatio { get; }

Property Value

float

Methods

Evaluate(int, int)

Returns zero for no remaining lives, otherwise one to three stars. Extra lives are capped at the starting total for this ratio.

public int Evaluate(int remainingLives, int startingLives)

Parameters

remainingLives int
startingLives int

Returns

int