From 208dd630967db1e5e08c8ba033e0185b8d63feeb Mon Sep 17 00:00:00 2001 From: Daniel Szoke Date: Wed, 19 Dec 2018 08:39:13 -0500 Subject: [PATCH] Added numPlayers and numSpies to mission reference --- components/GameInProgress.js | 2 ++ components/MissionReference.js | 7 +++++-- server_modules/endRound.js | 3 ++- server_modules/startRound.js | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/components/GameInProgress.js b/components/GameInProgress.js index aff6210..e93616b 100644 --- a/components/GameInProgress.js +++ b/components/GameInProgress.js @@ -75,6 +75,8 @@ export default class GameInProgress extends React.Component { />
diff --git a/components/MissionReference.js b/components/MissionReference.js index 34c8a04..ddcb66c 100644 --- a/components/MissionReference.js +++ b/components/MissionReference.js @@ -5,11 +5,14 @@ import { Card, CardTitle, CardBody } from 'reactstrap' export default class MissionReference extends React.Component { render () { - const { missions, children, ...rest } = this.props + const { missions, numPlayers, numSpies, children, ...rest } = this.props return ( - Mission Reference + Game Reference +

+ Players: {numPlayers}, including {numSpies} spies. +

Mission Order: { missions.order.map((numPlayers, missionNum) => ( diff --git a/server_modules/endRound.js b/server_modules/endRound.js index 9206fd4..e188521 100644 --- a/server_modules/endRound.js +++ b/server_modules/endRound.js @@ -19,7 +19,8 @@ async function endRound (gameDb) { scores: '', missionNumber: '', winner: '', - voteResults: '' + voteResults: '', + numSpies: '' } }), gameDb.collection('teams').drop() diff --git a/server_modules/startRound.js b/server_modules/startRound.js index 4c25aef..b5157d6 100644 --- a/server_modules/startRound.js +++ b/server_modules/startRound.js @@ -52,6 +52,7 @@ async function startRound (gameDb) { playing: true, lastGameStart: new Date(), numPlayers: numPlayers, + numSpies: numSpies, missionChooserIndex: missionChooserIndex, missionFailIndex: (missionChooserIndex + 2) % numPlayers, missionNumber: 0,