kgoldrunner
KGrGameIO Class Reference
#include <kgrgameio.h>

Detailed Description
The KGrGameIO class handles I/O for text-files containing KGoldrunner games and levels.The games and levels that are released with KGoldrunner are installed in a "System" directory (e.g. .../share/apps/kgoldrunner/system). Those that the user composes or edits are stored in a "User" directory (e.g. $HOME/.kde/share/apps/kgoldrunner/user).
The class handles files in either KGoldrunner 2 format or KGoldrunner 3 format. In KGoldrunner 2 format, the data for games is in file "games.dat" and the data for levels is in multiple files "levels/<prefix><nnn>.grl". Each level-file has at least one line containing codes for the level's layout and can have optional extra lines containing a level name and a hint. In KGoldrunner 3 format, each game is in one file called "game_<prefix>.txt", containing the game-data and the data for all levels. The data formats are the same as for KGoldrunner 2, except that the first character of each line indicates what kind of data is in the rest of the line. "G" = game data, "L" = start of level data, with the level-number following the "L", and " " = level data, with line 1 being the layout codes, line 2 (optional) the level name and lines >2 (optional) the hint.
This class is used by the game and its editor and is also used by a utility program that finds game names, level names and hints and rewrites them in a format suitable for extracting strings that KDE translators can use.
KGoldrunner Game-File IO
Definition at line 80 of file kgrgameio.h.
Public Member Functions | |
| KGrGameIO () | |
| IOStatus | fetchGameListData (const QString &dir, QList< GameData * > &gameList) |
| IOStatus | fetchLevelData (const QString &dir, const QString &prefix, const int level, LevelData &d) |
Constructor & Destructor Documentation
| KGrGameIO::KGrGameIO | ( | ) |
Member Function Documentation
Find and read data for games, into a list of GameData structures.
Definition at line 30 of file kgrgameio.cpp.
| IOStatus KGrGameIO::fetchLevelData | ( | const QString & | dir, | |
| const QString & | prefix, | |||
| const int | level, | |||
| LevelData & | d | |||
| ) |
Find and read data for a level of a game, into a LevelData structure.
Definition at line 142 of file kgrgameio.cpp.
The documentation for this class was generated from the following files:
KDE 4.0 API Reference