From 1860f01b25f477eecb408c734014578a788829a4 Mon Sep 17 00:00:00 2001 From: MikeZyeman Date: Thu, 7 Oct 2021 17:47:59 +0200 Subject: [PATCH] Added methods placeField and switchPlayer() --- src/Game.java | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/src/Game.java b/src/Game.java index 1737bc9..1c359e8 100644 --- a/src/Game.java +++ b/src/Game.java @@ -1,13 +1,36 @@ public class Game { - Language language; + + private Gamefield gamefield; + Language language; + + private int player1 = 1; + private int player2 = 2; public Game() { - language = new Language("de"); + gamefield = new Gamefield(); + language = new Language("de"); + } + + public void placeField(int field) { + if (field > 9 || field < 1) { + // Fehler aufrufen von Klasse Sprache + return; + } + + gamefield.setField(field, player1); + + switchPlayer(); + + } + + public void switchPlayer() { + + } + public void changeLanguage(String language) { this.language.setOutputLanguage(language); } - }