diff --git a/bin/cards/maumau/model/Canceled.class b/bin/cards/maumau/model/Canceled.class index 3616afd..16dc969 100644 Binary files a/bin/cards/maumau/model/Canceled.class and b/bin/cards/maumau/model/Canceled.class differ diff --git a/bin/cards/maumau/model/Finished.class b/bin/cards/maumau/model/Finished.class index 9ba14ca..caea057 100644 Binary files a/bin/cards/maumau/model/Finished.class and b/bin/cards/maumau/model/Finished.class differ diff --git a/bin/cards/maumau/model/Normal.class b/bin/cards/maumau/model/Normal.class index 1883676..cc59868 100644 Binary files a/bin/cards/maumau/model/Normal.class and b/bin/cards/maumau/model/Normal.class differ diff --git a/bin/cards/maumau/model/SevenChosen.class b/bin/cards/maumau/model/SevenChosen.class index f8be00a..aff18e5 100644 Binary files a/bin/cards/maumau/model/SevenChosen.class and b/bin/cards/maumau/model/SevenChosen.class differ diff --git a/src/cards/maumau/model/Canceled.java b/src/cards/maumau/model/Canceled.java index 3659a89..2a80fb1 100644 --- a/src/cards/maumau/model/Canceled.java +++ b/src/cards/maumau/model/Canceled.java @@ -1,5 +1,8 @@ package cards.maumau.model; +import cards.Card; +import cards.Suit; + public class Canceled implements GameState{ private final ActionHandler handler; @@ -7,4 +10,13 @@ public class Canceled implements GameState{ Canceled(ActionHandler handler) { this.handler = handler; } + + public void addPlayer(Player player){} + public void startGame(){} + public void finishGame(){} + public void cancelGame(){} + public void chooseCard(Card c){} + public void chooseSuit(Suit suit){} + public void skip(){} + public void no7(){} } diff --git a/src/cards/maumau/model/Finished.java b/src/cards/maumau/model/Finished.java index 9ca4324..f2ba8e9 100644 --- a/src/cards/maumau/model/Finished.java +++ b/src/cards/maumau/model/Finished.java @@ -1,9 +1,21 @@ package cards.maumau.model; +import cards.Card; +import cards.Suit; + public class Finished implements GameState{ private final ActionHandler handler; Finished(ActionHandler handler) { this.handler = handler; } + + public void addPlayer(Player player){} + public void startGame(){} + public void finishGame(){} + public void cancelGame(){} + public void chooseCard(Card c){} + public void chooseSuit(Suit suit){} + public void skip(){} + public void no7(){} } diff --git a/src/cards/maumau/model/Normal.java b/src/cards/maumau/model/Normal.java index 64372b1..96d3705 100644 --- a/src/cards/maumau/model/Normal.java +++ b/src/cards/maumau/model/Normal.java @@ -1,9 +1,23 @@ package cards.maumau.model; +import cards.Card; +import cards.Suit; + public class Normal implements GameState{ private final ActionHandler handler; Normal(ActionHandler handler) { this.handler = handler; } + + public void addPlayer(Player player){} + public void startGame(){} + public void finishGame(){} + public void cancelGame(){ + + } + public void chooseCard(Card c){} + public void chooseSuit(Suit suit){} + public void skip(){} + public void no7(){} } diff --git a/src/cards/maumau/model/SevenChosen.java b/src/cards/maumau/model/SevenChosen.java index 37c72f6..fcf9117 100644 --- a/src/cards/maumau/model/SevenChosen.java +++ b/src/cards/maumau/model/SevenChosen.java @@ -1,9 +1,35 @@ package cards.maumau.model; +import cards.Card; +import cards.Suit; + public class SevenChosen implements GameState{ private final ActionHandler handler; SevenChosen(ActionHandler handler) { this.handler = handler; } + + public void addPlayer(Player player){} + public void startGame(){} + public void finishGame(){} + public void cancelGame(){} + + public void chooseCard(Card c){ + if (handler.canPlay(c)) { + handler.getGame().getPlayerHandler().getCurrentPlayer().playCard(c); + handler.increment7Counter(); + handler.getGame().getPlayerHandler().nextTurn(1); + } else { + + } + } + + public void chooseSuit(Suit suit){} + public void skip(){} + public void no7(){ + handler.getGame().getPlayerHandler().getCurrentPlayer().drawCards(2 * handler.get7Counter()); + handler.reset7Counter(); + handler.setGameState(new Normal(handler)); + } }