Add a host attribute
This commit is contained in:
parent
b06502d32a
commit
4ca10aadf2
1 changed files with 5 additions and 2 deletions
|
|
@ -7,6 +7,8 @@ import { createReadStream } from "fs";
|
|||
|
||||
export class Game {
|
||||
readonly id: string;
|
||||
readonly host: Player;
|
||||
public ingame: boolean;
|
||||
public teams: [Team, Team];
|
||||
public players: Player[];
|
||||
private _questions: Deck<question_deck>;
|
||||
|
|
@ -15,8 +17,10 @@ export class Game {
|
|||
public object: string;
|
||||
|
||||
|
||||
constructor(conf: config) {
|
||||
constructor(conf: config, host: Player) {
|
||||
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.
|
||||
switch (conf.game.cards.type) {
|
||||
|
|
@ -34,7 +38,6 @@ export class Game {
|
|||
this.teams[1].addQuestions(this._questions.draw(conf.game.hand_size));
|
||||
};
|
||||
|
||||
|
||||
get questions() { return this._questions; };
|
||||
|
||||
get objects() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue