Package persistence

Class MacaoPersistence

Constructor   Methods

This class is used to get the game score from the StorageManager and to open the save dialog in order to save the game score as a bookmark. It is also used to get the game score from the URL of the page, put it to the StorageManager and to restart the game.

Use the register methods to define the values, which are to be included in the saved game score. Use the methods setSaveDialogUrl() and openSaveDialog() to open the save dialog with the game score. Use the method closeWindowByOpener() to close the save dialog.

Use the methods getSaveDialogTitle(), getSaveDialogMessage() and getSaveDialogCloseButtonTitle() in the save dialog. This methods are providing internationalized texts, which where set by calling openSaveDialog().

Call the method openStartPage() to forward form the save dialog to the page with the StorageManager, if the save dialog is opened by a bookmark containing the game score. Call the method startGame() in the page with the StorageManager to start the game with or without a game score.

Constructor Summary
MacaoPersistence()
     This constructor is used to create a MacaoPersistence object.

Method Summary
integer calculateLengthInBits(integer positiveInteger)
     Use this utility method to calculate the number of bits, which is used to store an integer of a specified value.
void closeWindowByOpener()
     Call this method in the save dialog to close the save dialog.
MacaoPersistence getOpenerPersistence()
     Use method in the Save Dialog to get the Persistence object of the index frame, which opened the dialog.
String getSaveDialogCloseButtonTitle()
     Call this method in the save dialog to get the text for the close button title.
String getSaveDialogMessage()
     Call this method in the save dialog to get the text for the dialog message.
String getSaveDialogTitle()
     Call this method in the save dialog to get the text for the dialog title.
void openPage(String pageFramesetUrl, String openerPageName, Window startFrame)
     This method is called while loading a game score to open the current page of the score.
void openSaveDialog(integer width, integer height, optional String title, optional String message, optional String closeButtonTitle, optional String popupBlockerWarning, optional Function openWindowFunction)
     Call this method to open the save dialog.
void openStartPage(String startPageUrl)
     Call this method in the save dialog, to forward to the page with the StorageManager, while a saved game is reloaded.
void registerBoleanValue(String valueName)
     Call this method to register a storage value of type boolean.
void registerDecimalValue(String valueName, boolean signed, integer maxLengthInBits)
     Call this method to register a number storage value, which will be put to the game score with three decimal places.
void registerGameEvent(String gameEvent)
     Call this method to register a game event to be stored in the game score.
void registerIntegerValue(String valueName, boolean signed, integer maxLengthInBits)
     Call this method to register a storage value of type integer.
void registerInventoryItem(String inventoryObjectName, String itemName, String itemTitle, String imageUrl, optional String subTitle, optional integer maxQuantity, optional boolean isDecimalQuantity)
     Call this method to register an inventory item, which is to be stored in the game score.
void registerLanguage(String languageCode)
     Call this method to register a language for inclusion in the game score.
void registerPage(String pageName, String pageFramesetUrl)
     Call this method to register a content page for inclusion in the game score.
void registerStringValue(String valueName, integer maxLengthInBytes)
     Call this method to register a storage value of type String.
void registerVersion(integer versionNumber)
     Call this method to set the version of the save configuration.
void setSaveDialogUrl(String saveDialogUrl)
     Call this method to set the location of the save dilaog page.
void startGame(String firstPageUrl, Window startFrame, optional boolean showConfirmDialog)
     Call this method in the page with the StorageManager to start a new game or restart a game with a provided game score.

Constructor Details
MacaoPersistence()

Method Details
integer calculateLengthInBits(integer positiveInteger)

void closeWindowByOpener()

MacaoPersistence getOpenerPersistence()

String getSaveDialogCloseButtonTitle()

String getSaveDialogMessage()

String getSaveDialogTitle()

void openPage(String pageFramesetUrl, String openerPageName, Window startFrame)

void openSaveDialog(integer width, integer height, optional String title, optional String message, optional String closeButtonTitle, optional String popupBlockerWarning, optional Function openWindowFunction)

void openStartPage(String startPageUrl)

void registerBoleanValue(String valueName)

void registerDecimalValue(String valueName, boolean signed, integer maxLengthInBits)

void registerGameEvent(String gameEvent)

void registerIntegerValue(String valueName, boolean signed, integer maxLengthInBits)

void registerInventoryItem(String inventoryObjectName, String itemName, String itemTitle, String imageUrl, optional String subTitle, optional integer maxQuantity, optional boolean isDecimalQuantity)

void registerLanguage(String languageCode)

void registerPage(String pageName, String pageFramesetUrl)

void registerStringValue(String valueName, integer maxLengthInBytes)

void registerVersion(integer versionNumber)

void setSaveDialogUrl(String saveDialogUrl)

void startGame(String firstPageUrl, Window startFrame, optional boolean showConfirmDialog)