Advanced Strategic Command
Classes | Typedefs | Functions | Variables
loaders.h File Reference

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

#include <sigc++/sigc++.h>
#include "loki/Functor.h"
#include "ascstring.h"
#include "sgstream.h"
#include "messages.h"
#include "graphics/blitter.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.

Classes

class  tspfldloaders
 
class  tmaploaders
 
class  tgameloaders
 
class  tnetworkloaders
 
class  GameFileInformation
 
class  tsavegameloaders
 
struct  MapConinuationInfo
 

Typedefs

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

Functions

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

Variables

const int fileterminator
 
const char * savegameextension
 
const char * mapextension
 
const char * tournamentextension
 
bool suppressMapTriggerExecution
 
GameMapeventLocalizationMap
 used by setLocalizedEventMessage to get the map being loaded It's not nice having a global variable for that, but we need to persist the data for the Lua callbacks More...
 

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*, LOKI_TYPELIST_1(const ASCString&) > MapLoadingFunction

Definition at line 57 of file loaders.h.

Function Documentation

MapConinuationInfo findNextCampaignMap ( int  id = -1)
GameMap* loadreplay ( MemoryStreamStorage streambuf)
GameMap* mapLoadingExceptionChecker ( const ASCString filename,
MapLoadingFunction  loader 
)
void savegame ( const ASCString name,
GameMap gamemap 
)

saves the game located in actmap to the savegame file name

Definition at line 1456 of file loaders.cpp.

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

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

void savemap ( const ASCString name,
GameMap gamemap 
)
void savereplay ( GameMap gamemap,
int  num 
)

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

Definition at line 1470 of file loaders.cpp.

References actreplayversion, displaymessage(), fatalError(), GameMap::ReplayInfo::map, 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 1615 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 1579 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 1648 of file loaders.cpp.

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

Referenced by loadStartupMap().

Variable Documentation

GameMap* eventLocalizationMap

used by setLocalizedEventMessage to get the map being loaded It's not nice having a global variable for that, but we need to persist the data for the Lua callbacks

Definition at line 1013 of file loaders.cpp.

Referenced by getLoadingMap().

const int fileterminator
const char* mapextension
const char* savegameextension
bool suppressMapTriggerExecution

Definition at line 82 of file loaders.cpp.

Referenced by gamethread(), runTester(), and seteventtriggers().

const char* tournamentextension