3 * Iter Vehemens ad Necem (IVAN)
4 * Copyright (C) Timo Kiviluoto
5 * Released under the GNU General
8 * See LICENSING which should be included
9 * along with this file for more details
12 #ifndef __DATABASE_H__
13 #define __DATABASE_H__
15 #include "ivancommon.h"
26 template <class database
> struct databasememberbase
{
27 virtual ~databasememberbase () {}
28 virtual void ReadData(database
&, inputfile
&) = 0;
32 template <class type
> class databasecreator
{
34 typedef typename
type::database database
;
35 typedef typename
type::prototype prototype
;
36 typedef std::map
<festring
, databasememberbase
<database
> *> databasemembermap
;
38 virtual ~databasecreator () {}
40 static void ReadFrom (const festring
&baseFileName
);
41 static void FindDataBase (const database
*&, const prototype
*, int);
42 static void InstallDataBase (type
*, int);
43 static void CreateDataBaseMemberMap ();
44 static int CreateDivineConfigurations (const prototype
*, database
**, int);
47 static truth
AnalyzeData (inputfile
&, cfestring
&, database
&);
48 static void CheckDefaults (cfestring
&, database
&);
49 static void CreateLTerrainDataBaseMemberMap ();
50 static void SetBaseValue (cfestring
&, databasememberbase
<database
> *, database
&);
51 static databasemembermap
&GetDataBaseMemberMap();
55 class databasesystem
{
57 virtual ~databasesystem () {}
59 static void Initialize ();