import { CardRenderItemType } from './CardRenderItemType' ; import { Size } from './Size' ; import { Tags } from '../Tags' ; export enum AltSecondaryTag { REQ = 'req' , OXYGEN = 'oxygen' , TURMOIL = 'turmoil' , FLOATER = 'floater' , BLUE = 'blue' , MOON_MINING_RATE = 'moon-mine' , MOON_COLONY_RATE = 'moon-colony' , MOON_LOGISTICS_RATE = 'moon-road' } export interface ItemOptions { size ? : Size ; amount ? : number ; all ? : boolean ; digit ? : true | false | 'large' ; played ? : boolean ; secondaryTag ? : Tags | AltSecondaryTag ; multiplier ? : boolean ; cancelled ? : boolean ; over ? : number ; } export class CardRenderItem { public anyPlayer ? : boolean ; public showDigit ? : boolean ; public amountInside ? : boolean ; public isPlayed ? : boolean ; public text ? : string ; public isUppercase ? : boolean ; public isBold ? : boolean ; public isPlate ? : boolean ; public size ? : Size ; public secondaryTag ? : Tags | AltSecondaryTag ; public multiplier ? : boolean = false ; public cancelled ? : boolean = false ; over ? : number ; constructor ( public type , public amount = - 1 , options ? ) { switch ( options ?. digit ) { case true : this . showDigit = true ; break ; case false : break ; case 'large' : default : this . showDigit = Math . abs ( this . amount ) > 5 ? true : undefined ; } if ( options === undefined ) { return this ; } this . size = options . size ; if ( options . amount !== undefined ) { this . amount = options . amount ; } this . anyPlayer = options . all ; this . isPlayed = options . played ; this . secondaryTag = options . secondaryTag ; if ( options . multiplier === true ) { this . amountInside = true ; this . multiplier = true ; } this . cancelled = options . cancelled ?? false ; this . over = options . over ; return this ; } }