mirror of
https://github.com/AlecM33/Werewolf.git
synced 2025-12-26 07:47:50 +01:00
further redis effort
This commit is contained in:
@@ -5,7 +5,7 @@ class Game {
|
||||
people,
|
||||
deck,
|
||||
hasTimer,
|
||||
moderator,
|
||||
currentModeratorId,
|
||||
hasDedicatedModerator,
|
||||
originalModeratorId,
|
||||
createTime,
|
||||
@@ -13,7 +13,7 @@ class Game {
|
||||
) {
|
||||
this.accessCode = accessCode;
|
||||
this.status = status;
|
||||
this.moderator = moderator;
|
||||
this.currentModeratorId = currentModeratorId;
|
||||
this.people = people;
|
||||
this.deck = deck;
|
||||
this.gameSize = deck.reduce(
|
||||
@@ -23,11 +23,11 @@ class Game {
|
||||
this.hasTimer = hasTimer;
|
||||
this.hasDedicatedModerator = hasDedicatedModerator;
|
||||
this.originalModeratorId = originalModeratorId;
|
||||
this.previousModeratorId = null;
|
||||
this.createTime = createTime;
|
||||
this.timerParams = timerParams;
|
||||
this.isFull = this.gameSize === 1 && !this.hasDedicatedModerator;
|
||||
this.timeRemaining = null;
|
||||
this.spectators = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// noinspection DuplicatedCode
|
||||
const globals = require('../config/globals');
|
||||
|
||||
class Person {
|
||||
constructor (id, cookie, name, userType, gameRole = null, gameRoleDescription = null, alignment = null, assigned = false) {
|
||||
this.id = id;
|
||||
@@ -10,7 +12,8 @@ class Person {
|
||||
this.gameRoleDescription = gameRoleDescription;
|
||||
this.alignment = alignment;
|
||||
this.assigned = assigned;
|
||||
this.out = false;
|
||||
this.out = userType === globals.USER_TYPES.MODERATOR || userType === globals.USER_TYPES.SPECTATOR;
|
||||
this.killed = false;
|
||||
this.revealed = false;
|
||||
this.hasEnteredName = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user