Defined in src/game/game/entity/Stats.ts:30
Constructors
constructor
new default< T > ( host: T ) : default < T >
Defined in src/game/game/entity/Stats.ts:38
Methods
all
all( ) : IStatBase []
Defined in src/game/game/entity/Stats.ts:413
exceeds Max
exceeds Max( stat: IStat | Stat ) : boolean
Returns boolean
Defined in src/game/game/entity/Stats.ts:304
get
get< STAT_DATA > ( stat: IStat | Stat , allowFailure?: boolean ) : STAT_DATA & ( STAT_DATA extends IStatBase ? { base: STAT_DATA ; } : undefined )
Parameters
allowFailure: boolean = false
Returns STAT_DATA & ( STAT_DATA extends IStatBase ? { base: STAT_DATA ; } : undefined )
Defined in src/game/game/entity/Stats.ts:97
get Base Max
get Base Max( stat: IStat | Stat , allowFailure?: boolean ) : undefined | number
Parameters
allowFailure: boolean = false
Returns undefined | number
Defined in src/game/game/entity/Stats.ts:266
get Base Value
get Base Value( stat: IStat | Stat , allowFailure?: boolean ) : undefined | number
Parameters
allowFailure: boolean = false
Returns undefined | number
Defined in src/game/game/entity/Stats.ts:123
get Bonus
get Bonus( stat: IStat | Stat ) : undefined | number
Returns undefined | number
Defined in src/game/game/entity/Stats.ts:204
get Max
get Max( stat: IStat | Stat ) : number
Returns number
Defined in src/game/game/entity/Stats.ts:257
get Percent
get Percent( stat: IStat | Stat ) : number
Returns number
Defined in src/game/game/entity/Stats.ts:295
get Time Until Change
get Time Until Change( stat: IStat | Stat , allowFailure?: boolean ) : number
Parameters
Optional
allowFailure: boolean
Returns number
Defined in src/game/game/entity/Stats.ts:385
get Value
get Value( stat: IStat | Stat , allowFailure?: true ) : undefined | number
Parameters
Optional
allowFailure: true
Returns undefined | number
Defined in src/game/game/entity/Stats.ts:115
has
has( stat: IStat | Stat ) : boolean
Returns boolean
Defined in src/game/game/entity/Stats.ts:78
has Max
has Max( stat: IStat | Stat ) : boolean
Returns boolean
Defined in src/game/game/entity/Stats.ts:249
increase Change Timer
increase Change Timer( stat: IStat | Stat , amt?: number ) : T
Returns T
Defined in src/game/game/entity/Stats.ts:380
init
init( stat: Stat , initializer?: ( ( factory: default ) => any ) ) : T
Parameters
Optional
initializer: ( ( factory: default ) => any )
( factory: default ) : any
Returns any
Returns T
Defined in src/game/game/entity/Stats.ts:57
init( stat: Stat , value: number , initializer?: ( ( factory: default ) => any ) ) : T
Parameters
value: number
Optional
initializer: ( ( factory: default ) => any )
( factory: default ) : any
Returns any
Returns T
Defined in src/game/game/entity/Stats.ts:58
reduce Change Timer
reduce Change Timer( stat: IStat | Stat , amt?: number ) : T
Returns T
Defined in src/game/game/entity/Stats.ts:346
remove
remove( stat: IStat | Stat ) : T
Returns T
Defined in src/game/game/entity/Stats.ts:86
remove Change Timer
remove Change Timer( stat: IStat | Stat ) : T
Returns T
Defined in src/game/game/entity/Stats.ts:391
reset Change Timer
reset Change Timer( stat: IStat | Stat ) : T
Returns T
Defined in src/game/game/entity/Stats.ts:332
set Change Timer
set Change Timer( stat: IStat | Stat , timer: number , initializer?: ( ( factory: StatChangeTimerFactory ) => any ) ) : T
Returns T
Defined in src/game/game/entity/Stats.ts:320
set Max
set Max( stat: IStat | Stat , max: number , newValue?: number ) : T
Parameters
max: number
Optional
newValue: number
Returns T
Defined in src/game/game/entity/Stats.ts:276
update Timers
update Timers( ) : default < T >
Defined in src/game/game/entity/Stats.ts:407
Returns whether the stat exceeds its
max
value. If there is nomax
for this stat, returnsfalse
.