|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object us.asciiroth.client.store.HTML5Store
public class HTML5Store
WHAT 5 local storage API, which has been implemented in Safari, and may eventually be implemented in Firefox and Opera. At that point, saving games would just work.
Constructor Summary | |
---|---|
HTML5Store()
|
Method Summary | |
---|---|
void |
deleteGame(java.lang.String name,
com.google.gwt.user.client.Command callback)
Delete the game with this name. |
void |
getSavedGames(NamesCallback callback)
Get a list of names for all the current saved games. |
void |
loadBoard(java.lang.String name,
java.lang.String boardID,
StoreLoadCallback callback)
Load the board for the saved game indicated, with the given URL (this is the URL as specified in the map data, relative to the root directory of the game). |
void |
loadGame(java.lang.String name,
StoreLoadCallback callback)
Loads the player's JSON data from persistence and provides it to the callback instance. |
void |
loadScenario(StoreLoadCallback callback)
A bit of a hack... |
void |
saveGame(java.lang.String newName,
java.lang.String currentName,
java.lang.String player,
java.util.Map<java.lang.String,java.lang.String> boards,
com.google.gwt.user.client.Command callback)
Save the game, including the player and any changed but unsaved maps. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HTML5Store()
Method Detail |
---|
public void deleteGame(java.lang.String name, com.google.gwt.user.client.Command callback)
Store
deleteGame
in interface Store
public void getSavedGames(NamesCallback callback)
Store
getSavedGames
in interface Store
callback
- to receive saved game namespublic void loadBoard(java.lang.String name, java.lang.String boardID, StoreLoadCallback callback)
Store
loadBoard
in interface Store
name
- the name of the saved gameboardID
- the url of the board (public void loadGame(java.lang.String name, StoreLoadCallback callback)
Store
loadGame
in interface Store
name
- the name of the saved gamecallback
- an optional callback to execute after the game loadspublic void loadScenario(StoreLoadCallback callback)
Store
loadScenario
in interface Store
callback
- will be passed the file path to a directory, not a JSON blobpublic void saveGame(java.lang.String newName, java.lang.String currentName, java.lang.String player, java.util.Map<java.lang.String,java.lang.String> boards, com.google.gwt.user.client.Command callback)
Store
saveGame
in interface Store
newName
- the name of the gamecurrentName
- the current name of the playerplayer
- the player instance for this gameboards
- a map of boards keyed by their URLs that have changedcallback
- an optional callback command
|
0.7 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
© 2009 Alx Dark