Skip to content

Commit

Permalink
Added numPlayers and numSpies to mission reference
Browse files Browse the repository at this point in the history
  • Loading branch information
szokeasaurusrex committed Dec 19, 2018
1 parent 460182f commit 208dd63
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions components/GameInProgress.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ export default class GameInProgress extends React.Component {
/>
<br />
<MissionReference
numPlayers={gameStatus.numPlayers}
numSpies={gameStatus.numSpies}
missions={gameStatus.missions}
/>
</div>
Expand Down
7 changes: 5 additions & 2 deletions components/MissionReference.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Card {...rest}>
<CardBody>
<CardTitle>Mission Reference</CardTitle>
<CardTitle>Game Reference</CardTitle>
<p>
<strong>Players:</strong> {numPlayers}, including {numSpies} spies.
</p>
<p>
<strong>Mission Order: </strong>
{ missions.order.map((numPlayers, missionNum) => (
Expand Down
3 changes: 2 additions & 1 deletion server_modules/endRound.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ async function endRound (gameDb) {
scores: '',
missionNumber: '',
winner: '',
voteResults: ''
voteResults: '',
numSpies: ''
}
}),
gameDb.collection('teams').drop()
Expand Down
1 change: 1 addition & 0 deletions server_modules/startRound.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 208dd63

Please # to comment.