From 82af70d041bddd6457331b7f3a13dfbc1f60fbce Mon Sep 17 00:00:00 2001 From: strinsberg Date: Tue, 30 Jun 2020 10:59:35 -0600 Subject: [PATCH] Solving reviewer comments. --- src/classes/game/Card.js | 1 + src/classes/game/CyberEffect.js | 1 + src/classes/game/Deck.js | 10 +++++----- src/classes/game/Stack.js | 1 + src/components/game/PlayField.vue | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/classes/game/Card.js b/src/classes/game/Card.js index 37d659a4..ef1ddf3a 100755 --- a/src/classes/game/Card.js +++ b/src/classes/game/Card.js @@ -3,6 +3,7 @@ * @author Steve modified on 2020-05-25 */ +// Function to create a unique object id const uuidV1 = require('uuid/v1') /** diff --git a/src/classes/game/CyberEffect.js b/src/classes/game/CyberEffect.js index 98cc4b55..8d3fdaa2 100644 --- a/src/classes/game/CyberEffect.js +++ b/src/classes/game/CyberEffect.js @@ -3,6 +3,7 @@ * @author Steve on 2020-06-18 */ +// Function to create a unique object id const uuidV1 = require('uuid/v1') /** diff --git a/src/classes/game/Deck.js b/src/classes/game/Deck.js index be5c6930..60b68f62 100755 --- a/src/classes/game/Deck.js +++ b/src/classes/game/Deck.js @@ -40,14 +40,14 @@ export default class Deck { constructor () { this.cards = [] this.discard = [] - this.addCards(cardTypes) + this.addCards(cardTypes, 4) } /** * Initializes the deck with a pre determined number and type of cards. * Shuffles the deck. */ - addCards (cardsToAdd) { + addCards (cardsToAdd, shuffles) { for (let [type, values] of Object.entries(cardsToAdd)) { for (let [value, number] of Object.entries(values)) { for (let i = 0; i < number; i++) { @@ -56,9 +56,9 @@ export default class Deck { } } // Shuffle a few times to try and get a good random order - this.shuffle(this.cards) - this.shuffle(this.cards) - this.shuffle(this.cards) + for (let i = 0; i < shuffles; i++) { + this.shuffle(this.cards) + } } /** diff --git a/src/classes/game/Stack.js b/src/classes/game/Stack.js index 23e7e154..1384b01a 100755 --- a/src/classes/game/Stack.js +++ b/src/classes/game/Stack.js @@ -3,6 +3,7 @@ * @author Josh on 2017-03-13, Steven modified on 2020-05-25 */ +// Function to create a unique object id const uuidV1 = require('uuid/v1') // The maximum number of repeats allowed in a stack diff --git a/src/components/game/PlayField.vue b/src/components/game/PlayField.vue index b5fd03dd..31c84de7 100644 --- a/src/components/game/PlayField.vue +++ b/src/components/game/PlayField.vue @@ -33,7 +33,7 @@

Virus cards can be dragged onto any opponent stack that is highlighted red. Stacks with a Virus card on top will not be able to be added to. Those started with instructions cards will be worth 0 points and those started with - Group cards will be woth 50%. Virus cards can be removed with Antivirus and + Group cards will be worth 50%. Virus cards can be removed with Antivirus and Scan cards to restore your stacks full value

The scores from each stack are added up to help the player reach the score total.