Class NineSwitchesGameBoard
java.lang.Object
games.stendhal.server.entity.mapstuff.game.NineSwitchesGameBoard
- All Implemented Interfaces:
TurnListener
The game board for the 9 switches game.
- Author:
- hendrik
-
Constructor Summary
ConstructorsConstructorDescriptionNineSwitchesGameBoard(StendhalRPZone zone, int x, int y) creates a new NineSwitcheGameBoard. -
Method Summary
Modifier and TypeMethodDescriptiongets the name of the active player.voidonTurnReached(int currentTurn) This method is called when the turn number is reached.voidremove()removes the game board with all its switches from the worldvoidsetNPC(SpeakerNPC npc) sets the SpeakerNPC who manages this game.voidsetPlayerName(String playerName) sets the name of the active player ornullif no game is active.voidusedSwitch(RPEntity user, NineSwitchesGameSwitch gameSwitch) use the specified switch.
-
Constructor Details
-
NineSwitchesGameBoard
creates a new NineSwitcheGameBoard.- Parameters:
zone- zone the board is placed intox- x-coordinatey- y-coordinate
-
-
Method Details
-
usedSwitch
use the specified switch.- Parameters:
user- player who used the switchgameSwitch- switch which was used
-
setPlayerName
sets the name of the active player ornullif no game is active.- Parameters:
playerName- name of player
-
getPlayerName
gets the name of the active player.- Returns:
- name of player, or
nullif no game is active.
-
setNPC
sets the SpeakerNPC who manages this game.- Parameters:
npc- SpeakerNPC
-
onTurnReached
public void onTurnReached(int currentTurn) Description copied from interface:TurnListenerThis method is called when the turn number is reached.- Specified by:
onTurnReachedin interfaceTurnListener- Parameters:
currentTurn- current turn number
-
remove
public void remove()removes the game board with all its switches from the world
-