0
0
Fork 0

Add a host attribute

This commit is contained in:
Oliver-Akins 2020-12-26 14:36:32 -07:00
parent b06502d32a
commit 4ca10aadf2

View file

@ -7,6 +7,8 @@ import { createReadStream } from "fs";
export class Game { export class Game {
readonly id: string; readonly id: string;
readonly host: Player;
public ingame: boolean;
public teams: [Team, Team]; public teams: [Team, Team];
public players: Player[]; public players: Player[];
private _questions: Deck<question_deck>; private _questions: Deck<question_deck>;
@ -15,8 +17,10 @@ export class Game {
public object: string; public object: string;
constructor(conf: config) { constructor(conf: config, host: Player) {
this.id = Game.generateID(conf.game.code_length); this.id = Game.generateID(conf.game.code_length);
this.host = host;
this.ingame = false;
// Get the decks based on what type of data they are. // Get the decks based on what type of data they are.
switch (conf.game.cards.type) { switch (conf.game.cards.type) {
@ -34,7 +38,6 @@ export class Game {
this.teams[1].addQuestions(this._questions.draw(conf.game.hand_size)); this.teams[1].addQuestions(this._questions.draw(conf.game.hand_size));
}; };
get questions() { return this._questions; }; get questions() { return this._questions; };
get objects() { get objects() {