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:412
exceeds Max
exceeds Max( stat: Stat | IStat ) : boolean
Returns boolean
Defined in src/game/game/entity/Stats.ts:303
get
get< STAT_DATA > ( stat: Stat | IStat , 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: Stat | IStat , 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: Stat | IStat , 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: Stat | IStat ) : undefined | number
Returns undefined | number
Defined in src/game/game/entity/Stats.ts:204
get Max
get Max( stat: Stat | IStat ) : number
Returns number
Defined in src/game/game/entity/Stats.ts:257
get Percent
get Percent( stat: Stat | IStat ) : number
Returns number
Defined in src/game/game/entity/Stats.ts:295
get Time Until Change
get Time Until Change( stat: Stat | IStat , allowFailure?: boolean ) : number
Parameters
Optional
allowFailure: boolean
Returns number
Defined in src/game/game/entity/Stats.ts:384
get Value
get Value( stat: Stat | IStat , allowFailure?: true ) : undefined | number
Parameters
Optional
allowFailure: true
Returns undefined | number
Defined in src/game/game/entity/Stats.ts:115
has
has( stat: Stat | IStat ) : boolean
Returns boolean
Defined in src/game/game/entity/Stats.ts:78
has Max
has Max( stat: Stat | IStat ) : boolean
Returns boolean
Defined in src/game/game/entity/Stats.ts:249
increase Change Timer
increase Change Timer( stat: Stat | IStat , amt?: number ) : T
Returns T
Defined in src/game/game/entity/Stats.ts:379
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: Stat | IStat , amt?: number ) : T
Returns T
Defined in src/game/game/entity/Stats.ts:345
remove
remove( stat: Stat | IStat ) : T
Returns T
Defined in src/game/game/entity/Stats.ts:86
remove Change Timer
remove Change Timer( stat: Stat | IStat ) : T
Returns T
Defined in src/game/game/entity/Stats.ts:390
reset Change Timer
reset Change Timer( stat: Stat | IStat ) : T
Returns T
Defined in src/game/game/entity/Stats.ts:331
set Change Timer
set Change Timer( stat: Stat | IStat , timer: number , initializer?: ( ( factory: StatChangeTimerFactory ) => any ) ) : T
Returns T
Defined in src/game/game/entity/Stats.ts:319
set Max
set Max( stat: Stat | IStat , 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:406
Returns whether the stat exceeds its
max
value. If there is nomax
for this stat, returnsfalse
.