import { Injectable } from '@angular/core' ; import { AllCardsService , ReferenceCard } from '@firestone-hs/reference-data' ; import { CARDS_VERSION } from '../../../../services/hs-utils' ; @ Injectable ( ) export class CardsFacadeStandaloneService { constructor ( private readonly service ) { } public async setLocale ( locale ) { const fileName = this . getFileName ( locale ) ; console . log ( 'initializing cards db with' , fileName ) ; await this . service . initializeCardsDb ( CARDS_VERSION , fileName ) ; console . log ( 'cards initialized' , this . service . getCards ( ) [ 0 ] ) ; } public getCard ( id , errorWhenUndefined = true ) { return this . service . getCard ( id , errorWhenUndefined ) ; } public getCardFromDbfId ( dbfId ) { return this . service . getCardFromDbfId ( dbfId ) ; } public getCardsFromDbfIds ( dbfIds ) { return this . service . getCardsFromDbfIds ( dbfIds ) ; } public getCards ( ) { return this . service . getCards ( ) ; } public getService ( ) { return this . service ; } private getFileName ( locale ) { return `cards_${ locale }.json` ; } }