Nicolas Fritz
2 years ago
10 changed files with 143 additions and 23 deletions
-
76uno/node/js/Game.js
-
11uno/node/js/Player.js
-
17uno/node/js/cards/Card.js
-
13uno/node/js/cards/special/ChooseColor.js
-
14uno/node/js/cards/special/PlusAmount.js
-
9uno/node/js/cards/special/Reverse.js
-
9uno/node/js/cards/special/Skip.js
-
14uno/node/tests/test_Card.test.js
-
2uno/node/tests/test_Game.test.js
-
1uno/node/tests/test_Player.test.js
@ -1,18 +1,27 @@ |
|||
//Imports
|
|||
const Card = require('../Card'); |
|||
const uno = require('../../uno'); |
|||
const {CARD_COLORS} = require("../../uno"); |
|||
|
|||
//Klasse ChooseColor für FarbWahlKarten
|
|||
class ChooseColor extends Card { |
|||
|
|||
//Konstruktor für das Erstellen einer ChooseColor-Karte
|
|||
constructor(name) { |
|||
constructor(gameInstanz) { |
|||
|
|||
//An Konstruktor von Cards weitergeben
|
|||
super(name, uno.CARD_COLORS[0]); |
|||
super("CC", uno.CARD_COLORS[0]); |
|||
|
|||
} |
|||
|
|||
putSelf() { |
|||
|
|||
//Todo: Spieler Möglichkeit geben Farbe zu wählen, nicht random
|
|||
this._color = CARD_COLORS[Math.floor(Math.random() * 4) + 1]; |
|||
|
|||
super.putSelf(); |
|||
} |
|||
|
|||
} |
|||
|
|||
//Exportiert Modul ChooseColor
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue