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
ConstructorDescriptionNineSwitchesGameBoard(StendhalRPZone zone, int x, int y)
creates a new NineSwitcheGameBoard. -
Method Summary
Modifier and TypeMethodDescriptiongets the name of the active player.void
onTurnReached(int currentTurn)
This method is called when the turn number is reached.void
remove()
removes the game board with all its switches from the worldvoid
setNPC(SpeakerNPC npc)
sets the SpeakerNPC who manages this game.void
setPlayerName(String playerName)
sets the name of the active player ornull
if no game is active.void
usedSwitch(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 ornull
if no game is active.- Parameters:
playerName
- name of player
-
getPlayerName
gets the name of the active player.- Returns:
- name of player, or
null
if 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:TurnListener
This method is called when the turn number is reached.- Specified by:
onTurnReached
in interfaceTurnListener
- Parameters:
currentTurn
- current turn number
-
remove
public void remove()removes the game board with all its switches from the world
-