[Gcblue-commits] gcb_wx/include/database tcDatabase.h,1.5,1.6 tcDatabaseObject.h,1.10,1.11 tcGeneric
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-07-18 03:18:09
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11624/include/database Modified Files: tcDatabase.h tcDatabaseObject.h tcGenericDBObject.h Log Message: Index: tcGenericDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcGenericDBObject.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcGenericDBObject.h 28 Mar 2004 23:12:27 -0000 1.7 --- tcGenericDBObject.h 18 Jul 2004 03:17:59 -0000 1.8 *************** *** 36,39 **** --- 36,41 ---- { + class tcFlightportDBObject; + /** * Models a generic platform that has weapon launchers and *************** *** 76,79 **** --- 78,82 ---- void Animate3DModel(); virtual const char* GetClassName() {return "Generic";} ///< returns class name of database object + tcFlightportDBObject* GetFlightport(); void RandInit(); virtual void PrintToFile(tcFile& file); Index: tcDatabaseObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDatabaseObject.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcDatabaseObject.h 28 Mar 2004 23:12:27 -0000 1.10 --- tcDatabaseObject.h 18 Jul 2004 03:17:59 -0000 1.11 *************** *** 87,90 **** --- 87,91 ---- #define MTYPE_PLATFORM 11 #define MTYPE_FIXEDWINGX 12 // model with more realism + #define MTYPE_AIRFIELD 13 // database object types (database class identifier) Index: tcDatabase.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDatabase.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcDatabase.h 28 Mar 2004 19:02:47 -0000 1.5 --- tcDatabase.h 18 Jul 2004 03:17:59 -0000 1.6 *************** *** 43,47 **** { ! class CsvTranslator; #ifndef NULL_INDEX --- 43,47 ---- { ! class CsvTranslator; #ifndef NULL_INDEX *************** *** 53,98 **** #define N_DATABASE_OBJECTS 1024 ! /*************** DATABASE ********************/ ! class tcDatabase ! { ! public: ! tcPool<tcDatabaseObject,N_DATABASE_OBJECTS> mcObjectData; ///< need to add accessor and iterator for this ! tcString mstrCurrentFile; ! UINT32 mnVersion; ! void Clear(void); ! void CreateDefaultDB(void); ! int CreateObjectCopy(tnPoolIndex anKey); ! int CreateObjectByType(UINT anClassID); ! int DeleteObject(tnPoolIndex anKey); ! tnPoolIndex GetRandomKey(void); ! tcDatabaseObject* GetRandomOfType(UINT model_type); ! tnPoolIndex GetSize(void) {return mcObjectData.GetCount();} ! int GetObject(tnPoolIndex anKey, tcDatabaseObject*& rpobj); ! tcDatabaseObject* GetObject(tnPoolIndex anKey); ! tcDatabaseObject* GetObject(std::string className); ///< gets object by class name ! int GetObjectClass(tnPoolIndex anKey, tcDBString& rzClass); ! tnPoolIndex GetFirstObjectOfClass(UINT anClassID); ! tnPoolIndex GetNextObjectOfSameClass(tnPoolIndex anKey); ! tnPoolIndex GetPrevObjectOfSameClass(tnPoolIndex anKey); ! tnPoolIndex GetKey(tcDBString& s); ! void GetVersion(int& v1, int& v2, int& v3); ! void LoadDB(void); ! void LoadDB(tcString astrDBFileName); ! void SaveDB(tcString astrDBFileName); ! void LoadDBCSV(std::string suffix = ""); ! void SaveDBCSV(std::string suffix = ""); ! void LoadDBXml(std::string suffix = ""); ! void SaveDBXml(std::string suffix = ""); ! void RandomizePlatforms(void); ! void PrintToFile(tcString); ! int Serialize(tcFile& file, bool mbLoad); ! int SerializeCSV(std::string suffix, bool mbLoad); ! void SerializeXml(std::string suffix, bool load); ! tcDatabase(); ! ~tcDatabase(); ! private: ! bool IsVersionSupported(void); ! }; } --- 53,104 ---- #define N_DATABASE_OBJECTS 1024 ! /** ! * Singleton class for interface with game object database ! */ ! class tcDatabase ! { ! public: ! static tcDatabase* Get(); ! tcPool<tcDatabaseObject,N_DATABASE_OBJECTS> mcObjectData; ///< need to add accessor and iterator for this ! tcString mstrCurrentFile; ! UINT32 mnVersion; ! ! void Clear(void); ! void CreateDefaultDB(void); ! int CreateObjectCopy(tnPoolIndex anKey); ! int CreateObjectByType(UINT anClassID); ! int DeleteObject(tnPoolIndex anKey); ! tnPoolIndex GetRandomKey(void); ! tcDatabaseObject* GetRandomOfType(UINT model_type); ! tnPoolIndex GetSize(void) {return mcObjectData.GetCount();} ! int GetObject(tnPoolIndex anKey, tcDatabaseObject*& rpobj); ! tcDatabaseObject* GetObject(tnPoolIndex anKey); ! tcDatabaseObject* GetObject(std::string className); ///< gets object by class name ! int GetObjectClass(tnPoolIndex anKey, tcDBString& rzClass); ! tnPoolIndex GetFirstObjectOfClass(UINT anClassID); ! tnPoolIndex GetNextObjectOfSameClass(tnPoolIndex anKey); ! tnPoolIndex GetPrevObjectOfSameClass(tnPoolIndex anKey); ! tnPoolIndex GetKey(tcDBString& s); ! void GetVersion(int& v1, int& v2, int& v3); ! void LoadDB(void); ! void LoadDB(tcString astrDBFileName); ! void SaveDB(tcString astrDBFileName); ! void LoadDBCSV(std::string suffix = ""); ! void SaveDBCSV(std::string suffix = ""); ! void LoadDBXml(std::string suffix = ""); ! void SaveDBXml(std::string suffix = ""); ! void RandomizePlatforms(void); ! void PrintToFile(tcString); ! int Serialize(tcFile& file, bool mbLoad); ! int SerializeCSV(std::string suffix, bool mbLoad); ! void SerializeXml(std::string suffix, bool load); ! ! private: ! tcDatabase(); ! ~tcDatabase(); ! ! bool IsVersionSupported(void); ! }; } |