|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbluegammon.logic.Player
bluegammon.logic.LocalPlayer
A local player has access to the actual device. A LocalPlayer
is
coupled with the BoardCanvas
, knowing the low-level gui states
and receives interaction calls from the gui.
Constructor Summary | |
LocalPlayer(int id,
char[] name,
boolean white,
BoardCanvas canvas)
Constructs a local player. |
Method Summary | |
boolean |
commandAction(javax.microedition.lcdui.Command c)
Called from BoardCanvas when a command is executed. |
void |
handleStringInput(java.lang.String s)
Called when user has entered some input as string. |
boolean |
keyPressed(int keyCode,
int gameCode)
Called from BoardCanvas when a key is pressed. |
void |
selectedChoice(byte choice,
boolean timeOut)
PopupListener implementation, called from a popup. |
Methods inherited from class bluegammon.logic.Player |
addListener, getId, getName, init, isWhite, setWhite |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LocalPlayer(int id, char[] name, boolean white, BoardCanvas canvas)
id
- The id of the local player.name
- The name of the local player.white
- The color of the local player.canvas
- The backgammon board canvas this local
player acts upon.Method Detail |
public boolean keyPressed(int keyCode, int gameCode)
BoardCanvas
when a key is pressed.
keyCode
- The key code.gameCode
- The game code.
public boolean commandAction(javax.microedition.lcdui.Command c)
BoardCanvas
when a command is executed.
c
- The command.
public void handleStringInput(java.lang.String s)
StringInputHandler
handleStringInput
in interface StringInputHandler
s
- The input.public void selectedChoice(byte choice, boolean timeOut)
selectedChoice
in interface PopupListener
choice
- The index of the alternatives that were chosen.timeOut
- True if the choice was made because of a time out.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |