import { BoardEntity } from '@firestone-hs/simulate-bgs-battle/dist/board-entity' ; import { NonFunctionProperties } from '../../../../services/utils' ; import { BgsFaceOffWithSimulation } from '../../../battlegrounds/bgs-face-off-with-simulation' ; export class BgsCustomSimulationState { public readonly faceOff : BgsFaceOffWithSimulation ; public readonly picker : BgsCustomSimulationPicker ; constructor ( ) { this . faceOff = this . buildInitialFaceOff ( ) ; } public update ( base ) { return Object . assign ( new BgsCustomSimulationState ( ) , this , base ) ; } public findEntity ( side , minionIndex ) { const existingSide = side === 'player' ? this . faceOff . battleInfo . playerBoard : this . faceOff . battleInfo . opponentBoard ; return existingSide . board [ minionIndex ] ; } public resetFaceOff ( ) { return this . update ( { faceOff : this . buildInitialFaceOff ( ) , } as BgsCustomSimulationState ) ; } private buildInitialFaceOff ( ) { return BgsFaceOffWithSimulation . create ( { battleInfo : { playerBoard : { board : [ ] , player : { cardId : 'TB_BaconShop_HERO_KelThuzad' , hpLeft : 40 , tavernTier : 6 , heroPowerId : null , heroPowerUsed : true , } , } , opponentBoard : { board : [ ] , player : { cardId : 'TB_BaconShop_HERO_KelThuzad' , hpLeft : 40 , tavernTier : 6 , heroPowerId : null , heroPowerUsed : true , } , } , options : { numberOfSimulations : 8000 , maxAcceptableDuration : 6000 , validTribes : undefined , } , } , } as BgsFaceOffWithSimulation ) ; } } export interface BgsCustomSimulationPicker { readonly type : 'minion' | 'hero' | 'minion-update' ; readonly side : 'player' | 'opponent' ; readonly minionIndex ? : number ; }