started on ActionHandler States
This commit is contained in:
parent
d58672a097
commit
a5632304bf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/cards/maumau/model/gamestate/GamePlay.class
Normal file
BIN
bin/cards/maumau/model/gamestate/GamePlay.class
Normal file
Binary file not shown.
BIN
bin/cards/maumau/model/gamestate/Initialized.class
Normal file
BIN
bin/cards/maumau/model/gamestate/Initialized.class
Normal file
Binary file not shown.
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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
|
||||
}
|
||||
|
5
src/cards/maumau/model/gamestate/GamePlay.java
Normal file
5
src/cards/maumau/model/gamestate/GamePlay.java
Normal file
@ -0,0 +1,5 @@
|
||||
package cards.maumau.model.gamestate;
|
||||
|
||||
public interface GamePlay<T> {
|
||||
|
||||
}
|
7
src/cards/maumau/model/gamestate/Initialized.java
Normal file
7
src/cards/maumau/model/gamestate/Initialized.java
Normal file
@ -0,0 +1,7 @@
|
||||
package cards.maumau.model.gamestate;
|
||||
|
||||
import cards.maumau.model.GameState;
|
||||
|
||||
public class Initialized implements GamePlay <GameState> {
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user