|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbluegammon.Game
Field Summary | |
static int |
AUDIO_OFF
Key for audio off (boolean) |
static int |
BLACK_PREFERRED
Key for preferred color (boolean) |
static int |
DEVICE_ID
Key for device id (int) |
static int |
GAME_TYPE_LOCAL
|
static int |
GAME_TYPE_REMOTE_BT_CLIENT
|
static int |
GAME_TYPE_REMOTE_BT_SERVER
|
static int |
GAMEREC_GAME_COUNT
First key in gamerecords, number of games against this opponent (int) |
static int |
GAMEREC_MY_SCORE
First key in gamerecords, player score (int) |
static int |
GAMEREC_OP_ID
First key in gamerecords, device ids (int) |
static int |
GAMEREC_OP_NAME
First key in gamerecords, opponent name (char[]) |
static int |
GAMEREC_OP_SCORE
First key in gamerecords, opponent score (int) |
static int |
GAMEREC_SAVED_GAME_DATA
First key in gamerecords, saved game data(byte[]) |
static int |
GAMEREC_TIMESTAMP
First key in gamerecords, timestamp (long) |
static int |
GAMERECORDS_SIZE
|
static int |
HAS_SAVED_LOCAL_GAME
Key for saved game boolean flag (boolean) |
static int |
PLAYER_NAME
Key for player name (char[]) |
static int |
RULES_PREFERRED
Key for preferred rules (int) |
static int |
SAVED_GAME_DATA
Key for saved game data (byte[]) |
static int |
VIBRA_OFF
Key for vibration off (boolean) |
Method Summary | |
void |
commandAction(javax.microedition.lcdui.Command c,
javax.microedition.lcdui.Displayable d)
|
static void |
exitGame()
Exits a game. |
static PopupCanvas |
getCanvas()
Returns current canvas |
static Popup |
getCurrentPopup()
Returns current displayed popup |
static int |
getGameType()
|
static void |
getStringInput(java.lang.String title,
char[] defaultText,
int length,
int constraints,
StringInputHandler ih)
Gets input from the user. |
static boolean |
hasSavedLocalGame()
Returns true if there exists a saved phone game |
static void |
init(BackGammon bg,
javax.microedition.lcdui.Display display)
|
static boolean |
isShowingPopup()
Returns true if a popup is currently displayed to the user |
static void |
resumeSavedLocalGame()
Resumes a saved game |
void |
selectedChoice(byte choice,
boolean timeOut)
|
static void |
setBackgammonConnection(BackgammonConnection conn)
|
static void |
setCanvas(PopupCanvas c)
Sets specified canvas as current |
static void |
setGameType(int gameType)
|
static Popup |
showPopup(char[] text,
char[][] altTexts,
int timeOutInSeconds,
int defaultChoice,
int timeOutChoice,
PopupListener listener)
Shows a popup on the device display, enabling the user to make a choice amongst specified alternatives. |
static void |
showRules()
Displays a popup with current rule settings. |
static void |
shutdown()
Shuts down the MIDlet. |
static void |
startLocalGame()
Start a new game for two players on one phone. |
static void |
startRemoteGame(boolean server,
char[] localName)
Starts a remote game, either as server or as client. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEVICE_ID
public static final int PLAYER_NAME
public static final int HAS_SAVED_LOCAL_GAME
public static final int SAVED_GAME_DATA
public static final int BLACK_PREFERRED
public static final int AUDIO_OFF
public static final int VIBRA_OFF
public static final int RULES_PREFERRED
public static final int GAMERECORDS_SIZE
public static final int GAMEREC_OP_ID
public static final int GAMEREC_OP_NAME
public static final int GAMEREC_MY_SCORE
public static final int GAMEREC_OP_SCORE
public static final int GAMEREC_GAME_COUNT
public static final int GAMEREC_TIMESTAMP
public static final int GAMEREC_SAVED_GAME_DATA
public static int GAME_TYPE_LOCAL
public static int GAME_TYPE_REMOTE_BT_SERVER
public static int GAME_TYPE_REMOTE_BT_CLIENT
Method Detail |
public static void setGameType(int gameType)
public static int getGameType()
public static void setBackgammonConnection(BackgammonConnection conn) throws java.io.IOException
java.io.IOException
public static void init(BackGammon bg, javax.microedition.lcdui.Display display)
public static boolean hasSavedLocalGame()
public static void startLocalGame()
public static void startRemoteGame(boolean server, char[] localName)
setBackgammonConnection
. It handshakes
with the other device and starts a new game, or resumes a game if any of the
devices has a saved game. On conflicting preferred settings (colors and rules)
the server wins.
server
- True if server, false if client.localName
- The name of this player.public static void resumeSavedLocalGame()
public static void exitGame()
public static void shutdown()
public static void showRules()
public static void getStringInput(java.lang.String title, char[] defaultText, int length, int constraints, StringInputHandler ih)
InputHandler
.
title
- The title of the input dialogdefaultText
- The default text presented in the input dialoglength
- The maximum length of the inputconstraints
- The constraints of the text as defined in TextField
ih
- The input handler, which handles the input as the user has
committed the textpublic static void setCanvas(PopupCanvas c)
c
- The canvas to setpublic static PopupCanvas getCanvas()
public static boolean isShowingPopup()
public static Popup getCurrentPopup()
public static Popup showPopup(char[] text, char[][] altTexts, int timeOutInSeconds, int defaultChoice, int timeOutChoice, PopupListener listener)
GameControl.getCurrentPopup()
or
GameControl.isShowingPopup()
text
- Character array with text presented in popup.altTexts
- Array of character arrays with alternatives presented in popup. If
this argument is null, no alternatives are presented.timeOutInSeconds
- The timeout in seconds. If this argument is set to zero, the popup
is displayed until the a user makes a choice. If no choices are
given and the timeout is zero, this popup will not show.defaultChoice
- The default selection when the popup appears.timeOutChoice
- The choice reported if the popup times out or is overridden by
another popup.listener
- The listener to this popup.public void selectedChoice(byte choice, boolean timeOut)
selectedChoice
in interface PopupListener
public void commandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Displayable d)
commandAction
in interface javax.microedition.lcdui.CommandListener
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |