us.asciiroth.client.store
Interface Store

All Known Implementing Classes:
AirStore, GearsStore, HTML5Store, MemoryStore

public interface Store

An interface describing a persistence provider for the game. There are currently four providers:

I am anticipating that HTML 5 will become better supported and that eventually, you'll just be able to play this game without any plug-ins.


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 url, 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 saveUnderName, 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.
 

Method Detail

deleteGame

void deleteGame(java.lang.String name,
                com.google.gwt.user.client.Command callback)
Delete the game with this name.

Parameters:
name -
callback -

getSavedGames

void getSavedGames(NamesCallback callback)
Get a list of names for all the current saved games.

Parameters:
callback - to receive saved game names

loadBoard

void loadBoard(java.lang.String name,
               java.lang.String url,
               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). Loads the board's JSON data from persistence and provides it to the callback instance.

Parameters:
name - the name of the saved game
url - the url of the board (
callback -

loadGame

void loadGame(java.lang.String name,
              StoreLoadCallback callback)
Loads the player's JSON data from persistence and provides it to the callback instance.

Parameters:
name - the name of the saved game
callback - an optional callback to execute after the game loads

loadScenario

void loadScenario(StoreLoadCallback callback)
A bit of a hack... in AIR, this presents a directory browsing dialog, and the callback is passed not JSON, but a file path to a directory which can then be used to attempt to load a scenario from disk.

Parameters:
callback - will be passed the file path to a directory, not a JSON blob

saveGame

void saveGame(java.lang.String saveUnderName,
              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. Once the save is completed, the optional callback instance will be executed.

Parameters:
saveUnderName - the name of the game
currentName - the current name of the player
player - the player instance for this game
boards - a map of boards keyed by their URLs that have changed
callback - an optional callback command

0.7

© 2009 Alx Dark