Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

loaders.h File Reference

procedure for loading and writing savegames, maps etc. More...

#include <sigc++/sigc++.h>
#include "libs/loki/Functor.h"
#include "ascstring.h"
#include "sgstream.h"
#include "messages.h"

Include dependency graph for loaders.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef Loki::Functor< GameMap *,
TYPELIST_1(const ASCString &) 
MapLoadingFunction )

Functions

void savemap (const char *name, GameMap *gamemap)
 saves the map located in actmap to the map file name
void savegame (const ASCString &name)
 saves the game located in actmap to the savegame file name
GameMapmapLoadingExceptionChecker (const ASCString &filename, MapLoadingFunction loader)
GameMaploadreplay (tmemorystreambuf *streambuf)
void savereplay (GameMap *gamemap, int num)
 writes all replay relevant map information of player num to the replay variable of actmap
bool validatemapfile (const ASCString &filename)
 checks, whether filename is a valid map file
bool validatesavfile (const ASCString &filename)
 checks, whether filename is a valid savegame
bool validateemlfile (const ASCString &filename)
 checks, whether filename is a valid email game
MapConinuationInfo findNextCampaignMap (int id=-1)

Variables

const int fileterminator
const char * savegameextension
const char * mapextension
const char * tournamentextension


Detailed Description

procedure for loading and writing savegames, maps etc.

IO for basic types like vehicletype, buildingtype etc which are also used by the small editors are found in sgstream

Definition in file loaders.h.


Typedef Documentation

typedef Loki::Functor<GameMap*, TYPELIST_1(const ASCString&) MapLoadingFunction)
 

Definition at line 56 of file loaders.h.


Function Documentation

MapConinuationInfo findNextCampaignMap int  id = -1  ) 
 

Definition at line 1553 of file loaders.cpp.

References actmapversion, GameMap::Campaign::avail, CharBuf::buf, GameMap::campaign, GameMap::codeWord, MapConinuationInfo::codeword, MapConinuationInfo::filename, fileterminator, tfindfile::getnextname(), GameMap::Campaign::id, mapextension, GameMap::maptitle, minmapversion, tnstream::reading, tnstream::readInt(), tspfldloaders::readmap(), tnstream::readpchar(), tnstream::readWord(), tspfldloaders::spfld, tspfldloaders::stream, and MapConinuationInfo::title.

Referenced by NextCampaignMap::search().

GameMap* loadreplay tmemorystreambuf streambuf  ) 
 

Definition at line 1367 of file loaders.cpp.

References actreplayversion, displaymessage(), ASCmsgException::getMessage(), tsavegameloaders::loadgame(), minreplayversion, tnstream::reading, and tnstream::readInt().

Referenced by trunreplay::run().

GameMap* mapLoadingExceptionChecker const ASCString filename,
MapLoadingFunction  loader
 

Definition at line 1412 of file loaders.cpp.

References displaymessage(), and ASCmsgException::getMessage().

Referenced by StartMultiplayerGame::Apply(), continuenetworkgame(), NextCampaignMap::getMap(), k_loadmap(), loadGame(), loadmap(), mapeditorMainThread(), networksupervisor(), and StartMultiplayerGame::start().

void savegame const ASCString name  ) 
 

saves the game located in actmap to the savegame file name

Definition at line 1326 of file loaders.cpp.

References displaymessage(), and tsavegameloaders::savegame().

Referenced by execuseraction(), NextMap::execute(), GuiFunctions::EndTurn::execute(), GameMap::read(), and saveGame().

void savemap const char *  name,
GameMap gamemap
 

saves the map located in actmap to the map file name

Definition at line 1304 of file loaders.cpp.

References displaymessage(), and tmaploaders::savemap().

Referenced by editpolygon(), and k_savemap().

void savereplay GameMap gamemap,
int  num
 

writes all replay relevant map information of player num to the replay variable of actmap

Definition at line 1341 of file loaders.cpp.

References actreplayversion, displaymessage(), fatalError(), GameMap::replayinfo, tsavegameloaders::savegame(), tnstream::writeInt(), and tnstream::writing.

Referenced by initReplayLogging().

bool validateemlfile const ASCString filename  ) 
 

checks, whether filename is a valid email game

Definition at line 1486 of file loaders.cpp.

References actnetworkversion, fileterminator, minnetworkversion, tnstream::reading, tnstream::readInt(), tnstream::readpchar(), and tnstream::readWord().

Referenced by loadStartupMap().

bool validatemapfile const ASCString filename  ) 
 

checks, whether filename is a valid map file

Definition at line 1450 of file loaders.cpp.

References actmapversion, fileterminator, minmapversion, tnstream::reading, tnstream::readInt(), tnstream::readpchar(), and tnstream::readWord().

Referenced by loadStartupMap().

bool validatesavfile const ASCString filename  ) 
 

checks, whether filename is a valid savegame

Definition at line 1519 of file loaders.cpp.

References actsavegameversion, fileterminator, minsavegameversion, tnstream::reading, tnstream::readInt(), tnstream::readpchar(), and tnstream::readWord().

Referenced by loadStartupMap().


Variable Documentation

const int fileterminator
 

Definition at line 69 of file loaders.cpp.

Referenced by findNextCampaignMap(), tsavegameloaders::loadgame(), tnetworkloaders::loadnwgame(), tsavegameloaders::savegame(), tmaploaders::savemap(), tnetworkloaders::savenwgame(), validateemlfile(), validatemapfile(), and validatesavfile().

const char* mapextension
 

Definition at line 73 of file loaders.cpp.

Referenced by findNextCampaignMap(), k_loadmap(), k_savemap(), loadStartupMap(), mapeditorMainThread(), and StartMultiplayerGame::userHandler().

const char* savegameextension
 

Definition at line 72 of file loaders.cpp.

Referenced by NextMap::execute(), GuiFunctions::EndTurn::execute(), loadGame(), loadStartupMap(), and saveGame().

const char* tournamentextension
 

Definition at line 74 of file loaders.cpp.

Referenced by FileTransfer::constructFileName(), continuenetworkgame(), loadStartupMap(), networksupervisor(), and FileTransfer::send().


Generated on Tue Jun 24 01:48:37 2008 for Advanced Strategic Command by  doxygen 1.4.2