From a5632304bf827f2d2ea119364c60bc24a3f8be56 Mon Sep 17 00:00:00 2001 From: peet Date: Sat, 8 Jun 2024 21:51:49 +0200 Subject: [PATCH] started on ActionHandler States --- bin/cards/maumau/gui/GameTableModel.class | Bin 1768 -> 1702 bytes bin/cards/maumau/gui/PlayerFrame.class | Bin 8914 -> 8430 bytes bin/cards/maumau/model/ActionHandler.class | Bin 1953 -> 2220 bytes bin/cards/maumau/model/GameState.class | Bin 1217 -> 1097 bytes .../maumau/model/gamestate/GamePlay.class | Bin 0 -> 189 bytes .../maumau/model/gamestate/Initialized.class | Bin 0 -> 473 bytes src/cards/maumau/model/ActionHandler.java | 7 +++++++ src/cards/maumau/model/GameState.java | 13 ++----------- .../maumau/model/gamestate/GamePlay.java | 5 +++++ .../maumau/model/gamestate/Initialized.java | 7 +++++++ 10 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 bin/cards/maumau/model/gamestate/GamePlay.class create mode 100644 bin/cards/maumau/model/gamestate/Initialized.class create mode 100644 src/cards/maumau/model/gamestate/GamePlay.java create mode 100644 src/cards/maumau/model/gamestate/Initialized.java diff --git a/bin/cards/maumau/gui/GameTableModel.class b/bin/cards/maumau/gui/GameTableModel.class index eafd47fd1900edf390d52a8e48552fa4ef125460..961bf9c039c851e9e246e68cb242045ea3e04c4e 100644 GIT binary patch delta 228 zcmaFCyNs9X)W2Q(7#J8F83HzP*)rF&Gk7pE@Mk5KCFGWdq( z6{QyE=ai+UC?x0S7G&lmmSpDVDHIgtC*`E(S}AaGx;y&1#`}l41}P*b=H=y=C?usS z!1a{mD*0+fv92-WDo-K7#aM)s{8?iTR5ly delta 276 zcmZ3+`+}G2)W2Q(7#J8F8NxPl*)rF2F~~7^@Gy8Xcrh~Yq^Fj+C+4OGmn4>?GBPM= zX!;~47Nr#H=O&f{k$!G|N@|WiT!l3!gAaorJA*GHgA6`(JPiH}0gMd1?vB2$@y?EZ z&aOVLE{qIvAj1vtn;yi&5De1G3D)Z$<{Gs5BJ(sR?L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qx=Z#nnq-$tF$9wyu3h^ zVIf6vI>RXKo(@d{x>~W@mM2_9`B49~V<4)tn>8)nFnG zN+B+d**4AJ{=HLOygcbc8I13~P9?f+1OYaYR}5 zH6CIw%||@nPhB+0FrOt_4zduo3L1s=dil8vsf5TCS`CmZ7=@QgtT*{D66t%`K`P|8 LFQdBxMQeWnC`hV$n!gm{2s@lFUM8B~5%Jf(?;KB>fAT+1uIE zE-FM*OMZu6VIj`BDq$uw=RW72_dVy%yawL$1;@) z_{}07k4iAaqtoES7-`8fbUc^Z;PIp_Q4%pc>oY5o28>k@#AmmOWxCzj8_IarvowNnh9U|2yqt{|fzn^2Hb@Q^DgoTE)ek90-j z#s#&|A`Ay%JVGW26A^Mj$RiYjP>(PkoS^uVv|^Z|_dNLldA4XJDNmE1ENo2DTxT#u zCrqP)3|=EocgHcUDrGgzz2|iFM^0sw%(FP{j4j2x!>D%=jxt-9TZI&scYT3x;xrMn@C_B=p?7Q zDOrB<|EBc%Tm2?n{CBJsgZ5{7OAn{u@VrL+0)hv}W*l=RyBZkH-(kNoF@VEpGR-6o T7@h6+Ats&fc6fwow;%ri;K+Se literal 0 HcmV?d00001 diff --git a/src/cards/maumau/model/ActionHandler.java b/src/cards/maumau/model/ActionHandler.java index e4cbbdb..cf99291 100644 --- a/src/cards/maumau/model/ActionHandler.java +++ b/src/cards/maumau/model/ActionHandler.java @@ -2,6 +2,7 @@ package cards.maumau.model; import cards.Card; import cards.Suit; +import cards.maumau.model.gamestate.*; /** * Manages the actions and state transitions within a MauMau game. @@ -11,6 +12,10 @@ class ActionHandler { private Suit chosenSuit; private int ctr7 = 0; + private GameState gameState; + + private GamePlay gameplay; + /** * Constructs an ActionHandler for the specified MauMau game. * @@ -18,6 +23,8 @@ class ActionHandler { */ ActionHandler(MauMau game) { this.game = game; + gameState = GameState.GAME_PLAY; + gameplay = new Initialized(); } /** diff --git a/src/cards/maumau/model/GameState.java b/src/cards/maumau/model/GameState.java index b85a2c7..a87cebb 100644 --- a/src/cards/maumau/model/GameState.java +++ b/src/cards/maumau/model/GameState.java @@ -7,23 +7,14 @@ public enum GameState { /** * The game has been initialized, but has not yet started. */ - GAME_INITIALIZED, + GAME_PLAY, /** * The game is over. The final ranking of players can be * obtained using {@link MauMau#getRanking()}. */ - GAME_OVER, + GAME_FINISHED, /** * The game has been canceled due to insufficient cards. */ GAME_CANCELED, - /** - * The game is currently in progress with players taking turns. - */ - PLAY, - /** - * The game is in progress and the current player has played - * a Jack, and is required to choose a suit. - */ - CHOOSE_SUIT } diff --git a/src/cards/maumau/model/gamestate/GamePlay.java b/src/cards/maumau/model/gamestate/GamePlay.java new file mode 100644 index 0000000..d054e15 --- /dev/null +++ b/src/cards/maumau/model/gamestate/GamePlay.java @@ -0,0 +1,5 @@ +package cards.maumau.model.gamestate; + +public interface GamePlay { + +} diff --git a/src/cards/maumau/model/gamestate/Initialized.java b/src/cards/maumau/model/gamestate/Initialized.java new file mode 100644 index 0000000..7dc949b --- /dev/null +++ b/src/cards/maumau/model/gamestate/Initialized.java @@ -0,0 +1,7 @@ +package cards.maumau.model.gamestate; + +import cards.maumau.model.GameState; + +public class Initialized implements GamePlay { + +}