diff --git a/server/src/objects/Game.ts b/server/src/objects/Game.ts index 447099f..7d7f9ba 100644 --- a/server/src/objects/Game.ts +++ b/server/src/objects/Game.ts @@ -45,13 +45,17 @@ export class Game { * definitions. */ private async loadDeck() { - let cards = JSON.parse( - await fs.readFile( - path.join(process.cwd(), "cards.json"), - `utf-8` - ) - ); - this._deck = new Deck(cards); + if (config.game.fuel_deck.type == "file:json") { + let cards = JSON.parse( + await fs.readFile( + path.join(process.cwd(), config.game.fuel_deck.location), + `utf-8` + ) + ); + this._deck = new Deck(cards); + } else { + throw new Error(`Unsupported data format for the cards: "${config.game.fuel_deck.type}"`) + } };