Advanced Strategic Command
Classes | Typedefs | Functions | Variables
itemrepository.cpp File Reference

Storage facility for all buildingtypes, vehicletypes etc. More...

#include <map>
#include <vector>
#include "typen.h"
#include "itemrepository.h"
#include "textfileparser.h"
#include "sgstream.h"
#include "textfile_evaluation.h"
#include "util/messaginghub.h"
#include "packagemanager.h"
#include "packagerepository.h"
Include dependency graph for itemrepository.cpp:

Go to the source code of this file.

Classes

class  TechAdapterLoader
 
class  FileCache
 

Typedefs

typedef vector
< TextFileDataLoader * > 
DataLoaders
 
typedef map< ASCString,
TextPropertyList
TextFileRepository
 

Functions

void duplicateIDError (const ASCString &itemtype, int id, const ASCString &file1, const ASCString &name1, const ASCString &file2, const ASCString &name2)
 
void loadalltextfiles ()
 
void registerDataLoader (TextFileDataLoader *dataLoader)
 registers a dataLoader . The object is delete after use, so use: registerDataLoader( new MyDataLoader() ) More...
 
void registerDataLoader (TextFileDataLoader &dataLoader)
 registers a dataLoader . More...
 
void loadAllData (bool useCache)
 

Variables

sigc::signal< void > dataLoaderTicker
 
const char * cacheFileName = "asc2.cache"
 
DataLoaders dataLoaders
 
DataLoaders dataLoadersToDelete
 
TextFileRepository textFileRepository
 
MineTypeRepository mineTypeRepository
 
ItemRepositoryLoader< VehicleTypevehicleTypeRepository ("vehicletype")
 
ItemRepositoryLoader< TerrainTypeterrainTypeRepository ("terraintype")
 
ItemRepositoryLoader< ObjectTypeobjectTypeRepository ("objecttype")
 
ItemRepositoryLoader
< BuildingType
buildingTypeRepository ("buildingtype")
 
ItemRepositoryLoader< TechnologytechnologyRepository ("technology")
 
TechAdapterContainer techAdapterContainer
 
const int cacheVersion = 34
 

Detailed Description

Storage facility for all buildingtypes, vehicletypes etc.

Definition in file itemrepository.cpp.

Typedef Documentation

typedef vector<TextFileDataLoader*> DataLoaders

Definition at line 39 of file itemrepository.cpp.

Definition at line 44 of file itemrepository.cpp.

Function Documentation

void duplicateIDError ( const ASCString itemtype,
int  id,
const ASCString file1,
const ASCString name1,
const ASCString file2,
const ASCString name2 
)

Definition at line 48 of file itemrepository.cpp.

References fatalError(), and strrr().

Referenced by ItemRepository< T >::RegisterID::operator()().

void loadAllData ( bool  useCache)
void loadalltextfiles ( )
void registerDataLoader ( TextFileDataLoader dataLoader)

registers a dataLoader . The object is delete after use, so use: registerDataLoader( new MyDataLoader() )

Definition at line 305 of file itemrepository.cpp.

References dataLoaders, and dataLoadersToDelete.

Referenced by loadAllData(), loaddata(), and loadEditordata().

void registerDataLoader ( TextFileDataLoader dataLoader)

registers a dataLoader .

Definition at line 311 of file itemrepository.cpp.

References dataLoaders.

Variable Documentation

ItemRepositoryLoader<BuildingType> buildingTypeRepository("buildingtype")
const char* cacheFileName = "asc2.cache"

Definition at line 37 of file itemrepository.cpp.

Referenced by FileCache::FileCache(), loadAllData(), and FileCache::write().

const int cacheVersion = 34

Definition at line 191 of file itemrepository.cpp.

Referenced by FileCache::FileCache(), and FileCache::write().

DataLoaders dataLoaders
DataLoaders dataLoadersToDelete

Definition at line 41 of file itemrepository.cpp.

Referenced by registerDataLoader(), and FileCache::~FileCache().

sigc::signal<void> dataLoaderTicker
MineTypeRepository mineTypeRepository

Definition at line 139 of file itemrepository.cpp.

Referenced by Maped_MainScreenWidget::selectMine().

ItemRepositoryLoader<ObjectType> objectTypeRepository("objecttype")
TechAdapterContainer techAdapterContainer
ItemRepositoryLoader<Technology> technologyRepository("technology")
ItemRepositoryLoader<TerrainType> terrainTypeRepository("terraintype")
TextFileRepository textFileRepository

Definition at line 45 of file itemrepository.cpp.

Referenced by loadAllData(), and loadalltextfiles().

ItemRepositoryLoader<VehicleType> vehicleTypeRepository("vehicletype")