diff --git a/bin/cards/maumau/model/ActionHandler.class b/bin/cards/maumau/model/ActionHandler.class index 0c8f2d4..f75a044 100644 Binary files a/bin/cards/maumau/model/ActionHandler.class and b/bin/cards/maumau/model/ActionHandler.class differ diff --git a/bin/cards/maumau/model/Canceled.class b/bin/cards/maumau/model/Canceled.class new file mode 100644 index 0000000..edb5901 Binary files /dev/null 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 new file mode 100644 index 0000000..8aff7e9 Binary files /dev/null and b/bin/cards/maumau/model/Finished.class differ diff --git a/bin/cards/maumau/model/GameState.class b/bin/cards/maumau/model/GameState.class new file mode 100644 index 0000000..5067285 Binary files /dev/null and b/bin/cards/maumau/model/GameState.class differ diff --git a/bin/cards/maumau/model/Initialized.class b/bin/cards/maumau/model/Initialized.class new file mode 100644 index 0000000..092d124 Binary files /dev/null and b/bin/cards/maumau/model/Initialized.class differ diff --git a/bin/cards/maumau/model/JackChosen.class b/bin/cards/maumau/model/JackChosen.class new file mode 100644 index 0000000..bb04f7c Binary files /dev/null and b/bin/cards/maumau/model/JackChosen.class differ diff --git a/bin/cards/maumau/model/MauMau.class b/bin/cards/maumau/model/MauMau.class index 2347370..a4409da 100644 Binary files a/bin/cards/maumau/model/MauMau.class and b/bin/cards/maumau/model/MauMau.class differ diff --git a/bin/cards/maumau/model/Normal.class b/bin/cards/maumau/model/Normal.class new file mode 100644 index 0000000..9acae6a Binary files /dev/null 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 new file mode 100644 index 0000000..4f593d0 Binary files /dev/null and b/bin/cards/maumau/model/SevenChosen.class differ diff --git a/bin/cards/maumau/model/SuitChosen.class b/bin/cards/maumau/model/SuitChosen.class new file mode 100644 index 0000000..20f3fd0 Binary files /dev/null and b/bin/cards/maumau/model/SuitChosen.class differ diff --git a/bin/cards/maumau/model/gamestate/Canceled.class b/bin/cards/maumau/model/gamestate/Canceled.class deleted file mode 100644 index cfd1f19..0000000 Binary files a/bin/cards/maumau/model/gamestate/Canceled.class and /dev/null differ diff --git a/bin/cards/maumau/model/gamestate/Finished.class b/bin/cards/maumau/model/gamestate/Finished.class deleted file mode 100644 index bff57d1..0000000 Binary files a/bin/cards/maumau/model/gamestate/Finished.class and /dev/null differ diff --git a/bin/cards/maumau/model/gamestate/GameState.class b/bin/cards/maumau/model/gamestate/GameState.class deleted file mode 100644 index 11f0392..0000000 Binary files a/bin/cards/maumau/model/gamestate/GameState.class and /dev/null differ diff --git a/bin/cards/maumau/model/gamestate/Initialized.class b/bin/cards/maumau/model/gamestate/Initialized.class deleted file mode 100644 index b081c43..0000000 Binary files a/bin/cards/maumau/model/gamestate/Initialized.class and /dev/null differ diff --git a/bin/cards/maumau/model/gamestate/JackChosen.class b/bin/cards/maumau/model/gamestate/JackChosen.class deleted file mode 100644 index b042ae0..0000000 Binary files a/bin/cards/maumau/model/gamestate/JackChosen.class and /dev/null differ diff --git a/bin/cards/maumau/model/gamestate/Normal.class b/bin/cards/maumau/model/gamestate/Normal.class deleted file mode 100644 index 58026d0..0000000 Binary files a/bin/cards/maumau/model/gamestate/Normal.class and /dev/null differ diff --git a/bin/cards/maumau/model/gamestate/SevenChosen.class b/bin/cards/maumau/model/gamestate/SevenChosen.class deleted file mode 100644 index c2276f0..0000000 Binary files a/bin/cards/maumau/model/gamestate/SevenChosen.class and /dev/null differ diff --git a/bin/cards/maumau/model/gamestate/SuitChosen.class b/bin/cards/maumau/model/gamestate/SuitChosen.class deleted file mode 100644 index 063c2b5..0000000 Binary files a/bin/cards/maumau/model/gamestate/SuitChosen.class and /dev/null differ diff --git a/src/cards/maumau/model/ActionHandler.java b/src/cards/maumau/model/ActionHandler.java index 5a92269..b542416 100644 --- a/src/cards/maumau/model/ActionHandler.java +++ b/src/cards/maumau/model/ActionHandler.java @@ -21,7 +21,7 @@ class ActionHandler { */ ActionHandler(MauMau game) { this.game = game; - gameState = new Initialized(); + gameState = new Initialized(this); } /** diff --git a/src/cards/maumau/model/gamestate/Canceled.java b/src/cards/maumau/model/Canceled.java similarity index 55% rename from src/cards/maumau/model/gamestate/Canceled.java rename to src/cards/maumau/model/Canceled.java index 689959b..37196f2 100644 --- a/src/cards/maumau/model/gamestate/Canceled.java +++ b/src/cards/maumau/model/Canceled.java @@ -1,4 +1,4 @@ -package cards.maumau.model.gamestate; +package cards.maumau.model; public class Canceled implements GameState{ diff --git a/src/cards/maumau/model/gamestate/Finished.java b/src/cards/maumau/model/Finished.java similarity index 55% rename from src/cards/maumau/model/gamestate/Finished.java rename to src/cards/maumau/model/Finished.java index cdd0dd2..651ce45 100644 --- a/src/cards/maumau/model/gamestate/Finished.java +++ b/src/cards/maumau/model/Finished.java @@ -1,4 +1,4 @@ -package cards.maumau.model.gamestate; +package cards.maumau.model; public class Finished implements GameState{ diff --git a/src/cards/maumau/model/GameState.java b/src/cards/maumau/model/GameState.java new file mode 100644 index 0000000..00e47ca --- /dev/null +++ b/src/cards/maumau/model/GameState.java @@ -0,0 +1,17 @@ +package cards.maumau.model; + +import cards.Card; +import cards.Suit; + + +public interface GameState { + 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(); + boolean canPlay(Card c); +} diff --git a/src/cards/maumau/model/Initialized.java b/src/cards/maumau/model/Initialized.java new file mode 100644 index 0000000..78ac9dd --- /dev/null +++ b/src/cards/maumau/model/Initialized.java @@ -0,0 +1,16 @@ +package cards.maumau.model; + +public class Initialized implements GameState { + + private final ActionHandler handler; + + Initialized(ActionHandler handler) { + this.handler = handler; + } + + public void addPlayer(Player player) { + handler.getGame().getPlayerHandler().addPlayer(player); + } + + +} diff --git a/src/cards/maumau/model/gamestate/JackChosen.java b/src/cards/maumau/model/JackChosen.java similarity index 56% rename from src/cards/maumau/model/gamestate/JackChosen.java rename to src/cards/maumau/model/JackChosen.java index 49998ea..6e95349 100644 --- a/src/cards/maumau/model/gamestate/JackChosen.java +++ b/src/cards/maumau/model/JackChosen.java @@ -1,4 +1,4 @@ -package cards.maumau.model.gamestate; +package cards.maumau.model; public class JackChosen implements GameState{ diff --git a/src/cards/maumau/model/MauMau.java b/src/cards/maumau/model/MauMau.java index 2fd65fc..0c972ee 100644 --- a/src/cards/maumau/model/MauMau.java +++ b/src/cards/maumau/model/MauMau.java @@ -61,7 +61,7 @@ public class MauMau { * * @return The player handler. */ - PlayerHandler getPlayerHandler() { + public PlayerHandler getPlayerHandler() { return playerHandler; } @@ -70,7 +70,7 @@ public class MauMau { * * @return The card handler. */ - CardHandler getCardHandler() { + public CardHandler getCardHandler() { return cardHandler; } diff --git a/src/cards/maumau/model/gamestate/Normal.java b/src/cards/maumau/model/Normal.java similarity index 54% rename from src/cards/maumau/model/gamestate/Normal.java rename to src/cards/maumau/model/Normal.java index 9ad9f46..a7e368f 100644 --- a/src/cards/maumau/model/gamestate/Normal.java +++ b/src/cards/maumau/model/Normal.java @@ -1,4 +1,4 @@ -package cards.maumau.model.gamestate; +package cards.maumau.model; public class Normal implements GameState{ diff --git a/src/cards/maumau/model/gamestate/SevenChosen.java b/src/cards/maumau/model/SevenChosen.java similarity index 57% rename from src/cards/maumau/model/gamestate/SevenChosen.java rename to src/cards/maumau/model/SevenChosen.java index 84c0585..5c2d73b 100644 --- a/src/cards/maumau/model/gamestate/SevenChosen.java +++ b/src/cards/maumau/model/SevenChosen.java @@ -1,4 +1,4 @@ -package cards.maumau.model.gamestate; +package cards.maumau.model; public class SevenChosen implements GameState{ diff --git a/src/cards/maumau/model/gamestate/SuitChosen.java b/src/cards/maumau/model/SuitChosen.java similarity index 56% rename from src/cards/maumau/model/gamestate/SuitChosen.java rename to src/cards/maumau/model/SuitChosen.java index 4de9ffe..9ccb255 100644 --- a/src/cards/maumau/model/gamestate/SuitChosen.java +++ b/src/cards/maumau/model/SuitChosen.java @@ -1,4 +1,4 @@ -package cards.maumau.model.gamestate; +package cards.maumau.model; public class SuitChosen implements GameState{ diff --git a/src/cards/maumau/model/gamestate/GameState.java b/src/cards/maumau/model/gamestate/GameState.java deleted file mode 100644 index 381e35f..0000000 --- a/src/cards/maumau/model/gamestate/GameState.java +++ /dev/null @@ -1,5 +0,0 @@ -package cards.maumau.model.gamestate; - -public interface GameState { - -} diff --git a/src/cards/maumau/model/gamestate/Initialized.java b/src/cards/maumau/model/gamestate/Initialized.java deleted file mode 100644 index 04eb82c..0000000 --- a/src/cards/maumau/model/gamestate/Initialized.java +++ /dev/null @@ -1,6 +0,0 @@ -package cards.maumau.model.gamestate; - - -public class Initialized implements GameState { - -}