added all the ActionHandler states
This commit is contained in:
parent
a5632304bf
commit
49d958652a
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/cards/maumau/model/gamestate/Canceled.class
Normal file
BIN
bin/cards/maumau/model/gamestate/Canceled.class
Normal file
Binary file not shown.
BIN
bin/cards/maumau/model/gamestate/Finished.class
Normal file
BIN
bin/cards/maumau/model/gamestate/Finished.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
bin/cards/maumau/model/gamestate/GameState.class
Normal file
BIN
bin/cards/maumau/model/gamestate/GameState.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
bin/cards/maumau/model/gamestate/JackChosen.class
Normal file
BIN
bin/cards/maumau/model/gamestate/JackChosen.class
Normal file
Binary file not shown.
BIN
bin/cards/maumau/model/gamestate/Normal.class
Normal file
BIN
bin/cards/maumau/model/gamestate/Normal.class
Normal file
Binary file not shown.
BIN
bin/cards/maumau/model/gamestate/SevenChosen.class
Normal file
BIN
bin/cards/maumau/model/gamestate/SevenChosen.class
Normal file
Binary file not shown.
BIN
bin/cards/maumau/model/gamestate/SuitChosen.class
Normal file
BIN
bin/cards/maumau/model/gamestate/SuitChosen.class
Normal file
Binary file not shown.
@ -14,8 +14,6 @@ class ActionHandler {
|
||||
|
||||
private GameState gameState;
|
||||
|
||||
private GamePlay gameplay;
|
||||
|
||||
/**
|
||||
* Constructs an ActionHandler for the specified MauMau game.
|
||||
*
|
||||
@ -23,8 +21,7 @@ class ActionHandler {
|
||||
*/
|
||||
ActionHandler(MauMau game) {
|
||||
this.game = game;
|
||||
gameState = GameState.GAME_PLAY;
|
||||
gameplay = new Initialized();
|
||||
gameState = new Initialized();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,20 +0,0 @@
|
||||
package cards.maumau.model;
|
||||
|
||||
/**
|
||||
* Represents the state of the Mau-Mau game.
|
||||
*/
|
||||
public enum GameState {
|
||||
/**
|
||||
* The game has been initialized, but has not yet started.
|
||||
*/
|
||||
GAME_PLAY,
|
||||
/**
|
||||
* The game is over. The final ranking of players can be
|
||||
* obtained using {@link MauMau#getRanking()}.
|
||||
*/
|
||||
GAME_FINISHED,
|
||||
/**
|
||||
* The game has been canceled due to insufficient cards.
|
||||
*/
|
||||
GAME_CANCELED,
|
||||
}
|
@ -2,6 +2,7 @@ package cards.maumau.model;
|
||||
|
||||
import cards.Card;
|
||||
import cards.Suit;
|
||||
import cards.maumau.model.gamestate.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
5
src/cards/maumau/model/gamestate/Canceled.java
Normal file
5
src/cards/maumau/model/gamestate/Canceled.java
Normal file
@ -0,0 +1,5 @@
|
||||
package cards.maumau.model.gamestate;
|
||||
|
||||
public class Canceled implements GameState{
|
||||
|
||||
}
|
5
src/cards/maumau/model/gamestate/Finished.java
Normal file
5
src/cards/maumau/model/gamestate/Finished.java
Normal file
@ -0,0 +1,5 @@
|
||||
package cards.maumau.model.gamestate;
|
||||
|
||||
public class Finished implements GameState{
|
||||
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
package cards.maumau.model.gamestate;
|
||||
|
||||
public interface GamePlay<T> {
|
||||
public interface GameState {
|
||||
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
package cards.maumau.model.gamestate;
|
||||
|
||||
import cards.maumau.model.GameState;
|
||||
|
||||
public class Initialized implements GamePlay <GameState> {
|
||||
public class Initialized implements GameState {
|
||||
|
||||
}
|
||||
|
5
src/cards/maumau/model/gamestate/JackChosen.java
Normal file
5
src/cards/maumau/model/gamestate/JackChosen.java
Normal file
@ -0,0 +1,5 @@
|
||||
package cards.maumau.model.gamestate;
|
||||
|
||||
public class JackChosen implements GameState{
|
||||
|
||||
}
|
5
src/cards/maumau/model/gamestate/Normal.java
Normal file
5
src/cards/maumau/model/gamestate/Normal.java
Normal file
@ -0,0 +1,5 @@
|
||||
package cards.maumau.model.gamestate;
|
||||
|
||||
public class Normal implements GameState{
|
||||
|
||||
}
|
5
src/cards/maumau/model/gamestate/SevenChosen.java
Normal file
5
src/cards/maumau/model/gamestate/SevenChosen.java
Normal file
@ -0,0 +1,5 @@
|
||||
package cards.maumau.model.gamestate;
|
||||
|
||||
public class SevenChosen implements GameState{
|
||||
|
||||
}
|
5
src/cards/maumau/model/gamestate/SuitChosen.java
Normal file
5
src/cards/maumau/model/gamestate/SuitChosen.java
Normal file
@ -0,0 +1,5 @@
|
||||
package cards.maumau.model.gamestate;
|
||||
|
||||
public class SuitChosen implements GameState{
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user