From ba2cfb3854f8eb5aabb89dc8c8e0670b8654792d Mon Sep 17 00:00:00 2001 From: FelixKrull Date: Wed, 9 Feb 2022 10:54:57 +0100 Subject: [PATCH] Rewrite GameLoop with new methods --- src/main/java/Game.java | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/src/main/java/Game.java b/src/main/java/Game.java index 84b8122..89ac454 100644 --- a/src/main/java/Game.java +++ b/src/main/java/Game.java @@ -14,32 +14,11 @@ public class Game { do { dice = p.rollDice(); - - /* - = Done rolldice() - --> dice(1-6) - = List getUsableFigures (dice, g, p) - --> {0,1,2,3} - int choose(List figs, p) - --> 1 - setFigure (p.figures.get(1), dice, g, p) - --> nächster Spieler - */ - - c++; - //g.checkFieldClear(p.startPos, p, g) - if(p.checkFigureInBase(p.figures) > 0 && dice == 6) { - int figId = p.choose() - 1; - //checkIfKicked + ArrayList usableFigures = g.getUsableFigures(dice, p, g); + int figId = p.choose(usableFigures); - p.figures.get(figId).setPosition(p.startPos); - } else { - int figId = p.choose() - 1; - //moveToDice - } } while (g.checkDice(dice, p, c)); - p.checkGameWin(p.figures); } }