diff --git a/src/main/java/de/hsfulda/onses/models/Game.java b/src/main/java/de/hsfulda/onses/models/Game.java index e5066bc..0fe4eb1 100644 --- a/src/main/java/de/hsfulda/onses/models/Game.java +++ b/src/main/java/de/hsfulda/onses/models/Game.java @@ -1,8 +1,13 @@ package de.hsfulda.onses.models; +import de.hsfulda.onses.services.GameService; + import java.util.ArrayList; public class Game { + + private GameService gameService; + private final ArrayList drawCardDeck = new ArrayList<>(); private Card lastPlayedCard = null; @@ -24,4 +29,12 @@ public class Game { drawCardDeck.add(card); } + public GameService getGameService() { + return gameService; + } + + public Game setGameService(GameService gameService) { + this.gameService = gameService; + return this; + } } diff --git a/src/main/java/de/hsfulda/onses/services/GameService.java b/src/main/java/de/hsfulda/onses/services/GameService.java index df7cf87..c9acd67 100644 --- a/src/main/java/de/hsfulda/onses/services/GameService.java +++ b/src/main/java/de/hsfulda/onses/services/GameService.java @@ -10,6 +10,7 @@ public class GameService { private final Game game; public GameService(Game game) { this.game = game; + this.game.setGameService(this); } public GameService() { this(new Game());