Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

palm/savegame_be.h File Reference

this is the interface to the savegame back-end More...

#include <palmutils.h>
#include <sections.h>

Go to the source code of this file.

Functions

int LoadAutoSave (void) SAVE_SECTION
 Load the autosave city.

void DeleteAutoSave (void) SAVE_SECTION
 Clear the autosave name.

void SetAutoSave (char *name)
 set the autosave name

void SaveGameByName (char *name) SAVE_SECTION
 save the city that is currently being used by the name passed

void DeleteGameByName (char *name) SAVE_SECTION
 Delete a city from the DB by name.

int LoadGameByName (char *name) SAVE_SECTION
 Load a game by name.

int GameExists (char *name) SAVE_SECTION
 Check if a saved city by this name exists.

int RenameCity (char *oldname, char *newname) SAVE_SECTION
 rename a city

int CopyCity (char *name) SAVE_SECTION
 copy a city

void ResetViewable (void) SAVE_SECTION
 Reset the viewable elements of the volatile game configuration.

char ** CityNames (int *count) SAVE_SECTION
 Get The City Names.

void FreeCityNames (char **names) SAVE_SECTION
 release the list of city names returned using cityNames

Int32 BeamCityByName (Char *cityName) SAVE_SECTION
 beam the city named

DmOpenRef OpenMyDB (void)
 Open up the savegame database.

void CloseMyDB (void)
 close the savegame database

UInt16 FindGameByName (char *name)
 Find a savegame by the name passed.


Detailed Description

this is the interface to the savegame back-end

Contains all the interfaces that are exported to the front-end

Definition in file savegame_be.h.


Function Documentation

Int32 BeamCityByName Char   cityName
 

beam the city named

Parameters:
cityName  the name of the city to beam
Returns:
-1 if the city could not be beamed

Definition at line 354 of file savegame_be.c.

References BeamSend(), Char, FindGameByName(), Int32, OpenMyDB(), UInt16, and UInt8.

char** CityNames int *    count
 

Get The City Names.

Parameters:
count  the count returned
Returns:
a NULL terminated array of the city names

Definition at line 592 of file savegame_be.c.

References CITYNAMELEN, comparator(), OpenMyDB(), and UInt16.

Referenced by UpdateSaveGameList().

void CloseMyDB void   
 

close the savegame database

This will close the savegame database if it is open, otherwise it will do nothing. Needed for the game shutdown routine

Definition at line 79 of file savegame_be.c.

Referenced by BeamReceive().

int CopyCity char *    name
 

copy a city

Parameters:
name  the name of the old city
Returns:
true if the city was copied

void DeleteGameByName char *    name
 

Delete a city from the DB by name.

Parameters:
name  the name of the city to delete

Definition at line 489 of file savegame_be.c.

References DeleteGameByIndex(), FindGameByName(), and UInt16.

Referenced by DeleteFromList().

UInt16 FindGameByName char *    name
 

Find a savegame by the name passed.

Parameters:
name  the name of the city
Returns:
the index, or LASTGAME if it's not there.

Definition at line 88 of file savegame_be.c.

References Char, _game_struct06a::cityname, OpenMyDB(), and UInt16.

Referenced by BeamCityByName(), BeamReceive(), DeleteGameByName(), GameExists(), LoadGameByName(), and SaveGameByName().

void FreeCityNames char **    names
 

release the list of city names returned using cityNames

Parameters:
names  the names of the cities

Definition at line 639 of file savegame_be.c.

Referenced by CleanSaveGameList(), and UpdateSaveGameList().

int GameExists char *    name
 

Check if a saved city by this name exists.

Parameters:
name  the name of the city
Returns:
true if game exists

Definition at line 256 of file savegame_be.c.

References FindGameByName().

Referenced by cnCreateButtonPressed().

int LoadGameByName char *    name
 

Load a game by name.

Parameters:
name  the name of the city
Returns:
0 if the city was loaded, -1 otherwise

Definition at line 343 of file savegame_be.c.

References FindGameByName(), LoadGameByIndex(), and UInt16.

Referenced by cnCreateButtonPressed(), LoadAutoSave(), and LoadFromList().

DmOpenRef OpenMyDB void   
 

Open up the savegame database.

Returns:
reference to the database or NULL.
If it does not exist, then it tries to create it.

Definition at line 40 of file savegame_be.c.

References Char, CITYNAMELEN, GetCreatorID(), and UInt16.

Referenced by BeamCityByName(), BeamReceive(), CityNames(), DeleteGameByIndex(), FindGameByName(), getAutoSaveName(), LoadGameByIndex(), RenameCity(), SaveGameByIndex(), and SetAutoSave().

int RenameCity char *    oldname,
char *    newname
 

rename a city

Parameters:
oldname  the old name of the city
newname  the new name of the city
Returns:
-1 if database could not be fount, 0 if not changes, 1 otherwise

Definition at line 498 of file savegame_be.c.

References Char, _game_struct06a::cityname, OpenMyDB(), and UInt16.

void ResetViewable void   
 

Reset the viewable elements of the volatile game configuration.

We set the tile size (16 pels). We reserve 2 tiles (one at the top, one at the bottom) for use with status information.

Definition at line 241 of file main.c.

void SaveGameByName char *    name
 

save the city that is currently being used by the name passed

Parameters:
name  the name of the city

Definition at line 262 of file savegame_be.c.

References FindGameByName(), SaveGameByIndex(), and UInt16.

Referenced by cnCreateButtonPressed(), and UISaveMyCity().

void SetAutoSave char *    name
 

set the autosave name

Parameters:
name  the name for the auto save game

Definition at line 423 of file savegame_be.c.

References CITYNAMELEN, and OpenMyDB().

Referenced by BeamReceive(), DeleteAutoSave(), and UISaveAutoGame().


Generated on Mon Aug 30 19:44:18 2004 for pocketcity by doxygen1.2.18