added room schema tests

This commit is contained in:
Wenszel
2023-11-19 20:32:12 +01:00
parent b70693afdd
commit d284fc30f1
3 changed files with 82 additions and 28 deletions
+1 -1
View File
@@ -62,7 +62,6 @@ RoomSchema.methods.canStartGame = function () {
RoomSchema.methods.startGame = function () {
this.started = true;
this.pawns = getStartPositions();
this.nextMoveTime = Date.now() + 15000;
this.players.forEach(player => (player.ready = true));
this.players[0].nowMoving = true;
@@ -80,6 +79,7 @@ RoomSchema.methods.getPlayer = function (playerId) {
};
RoomSchema.methods.addPlayer = function (name) {
if (this.full) return;
this.players.push({
name: name,
ready: false,