import L2Object from "./L2Object" ; export default class L2Buff extends L2Object { private _isDebuff ! : boolean ; private _skillLevel ! : number ; private _remainingTime ! : number ; private _description ! : string ; constructor ( id ? , level ? ) { super ( ) ; if ( id ) { this . Id = id ; } if ( level ) { this . SkillLevel = level ; } } public get IsDebuff ( ) : boolean { return this . _isDebuff ; } public set IsDebuff ( value ) { this . _isDebuff = value ; } public get SkillLevel ( ) : number { return this . _skillLevel ; } public set SkillLevel ( value ) { this . _skillLevel = value ; } public get RemainingTime ( ) : number { return this . _remainingTime ; } public set RemainingTime ( value ) { this . _remainingTime = value ; } public get Description ( ) : string { return this . _description ; } public set Description ( value ) { this . _description = value ; } public autoCountDown ( callback ? ) { const interval = setInterval ( ( ) => { this . RemainingTime = this . RemainingTime - 1 ; if ( this . RemainingTime <= 0 ) { this . RemainingTime = 0 ; clearInterval ( interval ) ; if ( callback ) { callback ( ) ; } } } , 1000 ) ; } }