diff --git a/uno/index.html b/uno/index.html index 08768cd..bd911e0 100644 --- a/uno/index.html +++ b/uno/index.html @@ -4,13 +4,13 @@ Uno +
-

+

+

+

- - - \ No newline at end of file diff --git a/uno/web/Style.js b/uno/web/Style.js index 6d555b0..48a88ae 100644 --- a/uno/web/Style.js +++ b/uno/web/Style.js @@ -1 +1,27 @@ -$("#spieler").html("Spieler: "); \ No newline at end of file + +export default class Style{ + + constructor(gameInstanz) { + this._game = gameInstanz; + } + + refreshDebug(){ + $("#player").html("Spieler: " + this.game.currentPlayerInstanz.name); + //$("#playerCards").html("Spieler: " + this.game.currentPlayerInstanz.name); + $("#cardOnDeck").html("Karte auf dem Tisch: " + this.game.cardOnDeck.name + " - " + this.game.cardOnDeck.color); + $("#playerInGame").html("Spieler im Spiel: " + this.game.players.length); + } + + showDebug(){ + $('#debug').show(); + } + + hideDebug(){ + $('#debug').hide(); + } + + get game(){ + return this._game; + } + +} \ No newline at end of file diff --git a/uno/web/uno.js b/uno/web/uno.js index 81432cb..86f4183 100644 --- a/uno/web/uno.js +++ b/uno/web/uno.js @@ -1,5 +1,6 @@ //Legt mögliche Farben fest, "NONE" sind Auswahlkarten import Game from "./Game.js"; +import Style from "./Style.js"; export const CARD_COLORS = ["NONE", "BLUE", "GREEN", "RED", "YELLOW"]; @@ -11,8 +12,10 @@ let rules = { } let game = new Game(2, rules); +let style = new Style(game); game.start(); -console.log(game.currentPlayer + game.cardOnDeck.name +""); +style.showDebug(); +style.refreshDebug();