|
@ -1,14 +1,27 @@ |
|
|
|
|
|
//Imports
|
|
|
const uno = require('../../uno'); |
|
|
const uno = require('../../uno'); |
|
|
const Card = require('../Card'); |
|
|
const Card = require('../Card'); |
|
|
|
|
|
|
|
|
|
|
|
//Klasse PlusAmount für Karten, die den nächsten Spieler ziehen lassen
|
|
|
class PlusAmount extends Card { |
|
|
class PlusAmount extends Card { |
|
|
|
|
|
|
|
|
|
|
|
//Konstruktor für das Erstellen einer PlusAmount-Karte (+4/+2)
|
|
|
constructor(name, color = uno.CARD_COLORS[0]) { |
|
|
constructor(name, color = uno.CARD_COLORS[0]) { |
|
|
|
|
|
|
|
|
|
|
|
//An Konstruktor von Cards weitergeben
|
|
|
super(name, color); |
|
|
super(name, color); |
|
|
|
|
|
|
|
|
|
|
|
//Wenn keine Farbe beim Konstruktor übergeben wird, plus = 4, sonst plus = 2
|
|
|
if (color === uno.CARD_COLORS[0]) this._plus = 4; else this._plus = 2; |
|
|
if (color === uno.CARD_COLORS[0]) this._plus = 4; else this._plus = 2; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//Gibt den PlusWert der Karte zurück
|
|
|
get plus() { |
|
|
get plus() { |
|
|
return this._plus; |
|
|
return this._plus; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//Exportiert Modul PlusAmount
|
|
|
module.exports = PlusAmount; |
|
|
module.exports = PlusAmount; |