|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface GUI
This interface has to be implemented by a "Rosenkoenig-GUI" that wants to show the course of the
game. Classes that implement GUI can be added to a
Game in order to be notified whenever GUI-events occur.
| Method Summary | |
|---|---|
void |
activatePlayer(Color color,
boolean activate)
Activate or deactivate the player's name string. |
void |
disablePlayer(Color color)
Disables all controls of a single player. |
void |
enableDrawDeck(ImageState state)
Enables / disables the draw deck. |
void |
enableEndTurn(ImageState state)
Enables / disables the GUI element that ends a player's turn |
void |
hideScoreChange(Color player)
This method tells the GUI to hide a player's score increase. |
void |
initGUI(Game game,
java.lang.String nameRed,
java.lang.String nameWhite)
Use this method to perform initialization. |
void |
redrawGUI()
forces the GUI to show all changes taken since the last call of redrawGUI. |
void |
setBoard(Color[][] board)
setBoard is called to replace the complete board. |
void |
setCards(Color color,
java.util.List<Card> cards)
This method is called whenever a player's card deck has changed and sets a player's card deck. |
void |
setCardState(Color color,
ImageState state,
int card,
boolean knightable)
setCardState is called whenever a card's state has changed. |
void |
setCrown(Position position)
This method is called to specify the position of the crown on the board. |
void |
setDrawDeck(int number)
Sets the number of cards left in the draw deck. |
void |
setKnights(Color color,
int number)
Sets the number of knights a player has left. |
void |
setKnightState(Color color,
ImageState state)
This method is called whenever a player's knights are enabled or disabled. |
void |
setPlayedDeck(int number,
Card playedCard)
Sets the number of cards left in the played cards deck. |
void |
setScore(Color color,
int score)
Updates a player's score. |
void |
setScoreChange(Color color,
int score)
After the player selects the card he wants to play, the GUI shows the possible score increase. |
void |
setStone(Color color,
Position position,
boolean perhaps)
Sets a stone on the board. |
| Method Detail |
|---|
void initGUI(Game game,
java.lang.String nameRed,
java.lang.String nameWhite)
game - the game this GUI belongs tonameRed - the red player's namenameWhite - the white player's nameGamevoid redrawGUI()
void setCards(Color color,
java.util.List<Card> cards)
color - playercards - card deck (up to five cards)
void setCardState(Color color,
ImageState state,
int card,
boolean knightable)
color - playerstate - enabled, disabled, selectedcard - index of the card that will be changedknightable - if set to true, the selected card is marked knightable
void setStone(Color color,
Position position,
boolean perhaps)
color - color of the stone or null to remove the stoneposition - the stone's positionperhaps - if set to true, the stone is drawn "misty"void setBoard(Color[][] board)
board - array (dimensions habe to be 9x9) of stones. A color represents a stone, null
represents an empty field
void setKnights(Color color,
int number)
color - playernumber - number of knights left
void setKnightState(Color color,
ImageState state)
color - playerstate - enabled, disabled
void setScore(Color color,
int score)
color - playerscore - new scorevoid disablePlayer(Color color)
color - player
void activatePlayer(Color color,
boolean activate)
color - the player's coloractivate - whether to activate the player or not
void setScoreChange(Color color,
int score)
color - playerscore - score increasevoid hideScoreChange(Color player)
player - the player whose score increase is to be hiddenvoid setDrawDeck(int number)
number - number of cards leftvoid enableDrawDeck(ImageState state)
state - enabled or disabled
void setPlayedDeck(int number,
Card playedCard)
number - number of cards leftplayedCard - the card that was played lastvoid enableEndTurn(ImageState state)
state - enabled or disabledvoid setCrown(Position position)
position - the crown's position
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||