[Gcblue-commits] gcb_wx/include/database tcStoresDBObject.h,NONE,1.1 tcAirDBObject.h,1.8,1.9 tcBalli
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-11-29 03:55:03
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21010/include/database Modified Files: tcAirDBObject.h tcBallisticDBObject.h tcDBObjSerializerSql.h tcDatabaseObject.h tcESMDBObject.h tcFixedDBObject.h tcFlightportDBObject.h tcGenericDBObject.h tcLauncherDBObject.h tcMissileDBObject.h tcOpticalDBObject.h tcRadarDBObject.h tcSensorDBObject.h tcWeaponDBObject.h Added Files: tcStoresDBObject.h Log Message: Magazine class tcStores and related Index: tcGenericDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcGenericDBObject.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcGenericDBObject.h 6 Nov 2004 15:13:39 -0000 1.11 --- tcGenericDBObject.h 29 Nov 2004 03:54:49 -0000 1.12 *************** *** 53,57 **** MAXLAUNCHERS = 8, MAXSENSORS = 8, ! MAXANIMATIONS = 4 }; float mfRcs_dbsm; ///< radar cross section, [dBsm] --- 53,58 ---- MAXLAUNCHERS = 8, MAXSENSORS = 8, ! MAXANIMATIONS = 4, ! MAXMAGAZINES = 3 }; float mfRcs_dbsm; ///< radar cross section, [dBsm] *************** *** 71,77 **** --- 72,81 ---- int mnNumLaunchers; + int mnNumMagazines; int mnNumSensors; tcDBString maLauncherClass[MAXLAUNCHERS]; + tcDBString maMagazineClass[MAXMAGAZINES]; tcDBString maSensorClass[MAXSENSORS]; + std::vector<long> sensorId; ///< database id's of sensors float launcherAz[MAXLAUNCHERS]; ///< pointing angles of launchers in degrees *************** *** 85,88 **** --- 89,93 ---- void Animate3DModel(); virtual const char* GetClassName() {return "Generic";} ///< returns class name of database object + bool IsLeaf() const; ///< returns true if db obj is a leaf obj tcFlightportDBObject* GetFlightport(); tc3DPoint GetLauncherPosition(unsigned n); --- NEW FILE: tcStoresDBObject.h --- /** ** @file tcStoresDBObject.h */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _STORESDBOBJECT_H_ #define _STORESDBOBJECT_H_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "tcDatabaseObject.h" #include <vector> class TiXmlElement; namespace Database { class tcSqlReader; #define MAX_LAUNCHER_CONFIGURATIONS 8 // number of weapon class/capacity options supported /** * Database object to describe storage, used for weapons magazines, etc. */ class tcStoresDBObject : public tcDatabaseObject { public: enum {MAX_STORES = 4}; std::string displayName; unsigned int capacity; float moveTime; ///< time to unload to or load from stores std::vector<std::string> compatibleItems; virtual const char* GetClassName() {return "Stores";} ///< returns class name of database object virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization virtual void SerializeXml(TiXmlElement* node, bool load); ///< XML serialization static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings static void AddSqlColumns(std::string& columnString); void ReadSql(tcSqlReader& entry); void WriteSql(std::string& valueString); tcStoresDBObject(); tcStoresDBObject(tcStoresDBObject& obj); ///< copy constructor virtual ~tcStoresDBObject(); }; } // namespace Database #endif Index: tcRadarDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcRadarDBObject.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcRadarDBObject.h 6 Nov 2004 15:13:39 -0000 1.10 --- tcRadarDBObject.h 29 Nov 2004 03:54:49 -0000 1.11 *************** *** 50,53 **** --- 50,54 ---- virtual tcSensorState* CreateSensor(tcGameObject* parent); ///< factory method virtual const char* GetClassName() {return "Radar";} ///< returns class name of database object + bool IsLeaf() const; ///< returns true if db obj is a leaf obj virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); Index: tcSensorDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcSensorDBObject.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcSensorDBObject.h 6 Nov 2004 15:13:39 -0000 1.7 --- tcSensorDBObject.h 29 Nov 2004 03:54:49 -0000 1.8 *************** *** 47,50 **** --- 47,51 ---- virtual tcSensorState* CreateSensor(tcGameObject* parent); ///< factory method virtual const char* GetClassName() {return "Sensor";} ///< returns class name of database object + bool IsLeaf() const; ///< returns true if db obj is a leaf obj virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); Index: tcFixedDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcFixedDBObject.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcFixedDBObject.h 8 Aug 2004 00:31:32 -0000 1.5 --- tcFixedDBObject.h 29 Nov 2004 03:54:49 -0000 1.6 *************** *** 39,42 **** --- 39,43 ---- public: virtual const char* GetClassName() {return "Fixed";} ///< returns class name of database object + bool IsLeaf() const; ///< returns true if db obj is a leaf obj virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); Index: tcLauncherDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcLauncherDBObject.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcLauncherDBObject.h 8 Aug 2004 00:31:32 -0000 1.8 --- tcLauncherDBObject.h 29 Nov 2004 03:54:49 -0000 1.9 *************** *** 33,66 **** namespace Database { ! class tcSqlReader; #define MAX_LAUNCHER_CONFIGURATIONS 8 // number of weapon class/capacity options supported ! class tcLauncherDBObject : public tcDatabaseObject ! { ! public: ! float cycleTime; ///< down time between shots ! tcDBString mzChildClass; ///< class of platform to launch (simple model) ! UINT mnCapacity; ///< max number of launch objects held (simple model) ! tcDBString maChildClass[MAX_LAUNCHER_CONFIGURATIONS]; ///< array for multiple options ! UINT maCapacity[MAX_LAUNCHER_CONFIGURATIONS]; ///< array for mult configs ! UINT mnConfigurations; ! std::string fireControlSensorClass; ///< class of sensor on platform for fire control ! ///< (track required to launch) ! virtual const char* GetClassName() {return "Launcher";} ///< returns class name of database object ! virtual void PrintToFile(tcFile& file); ! int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); ! int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization ! virtual void SerializeXml(TiXmlElement* node, bool load); ///< XML serialization ! static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings ! static void AddSqlColumns(std::string& columnString); ! void ReadSql(tcSqlReader& entry); ! void WriteSql(std::string& valueString); ! tcLauncherDBObject(); ! tcLauncherDBObject(tcLauncherDBObject& obj); ///< copy constructor ! virtual ~tcLauncherDBObject(); ! }; } // namespace Database --- 33,71 ---- namespace Database { ! class tcSqlReader; #define MAX_LAUNCHER_CONFIGURATIONS 8 // number of weapon class/capacity options supported + /** + * + */ + class tcLauncherDBObject : public tcDatabaseObject + { + public: + float cycleTime; ///< down time between shots + tcDBString mzChildClass; ///< class of platform to launch (simple model) + UINT mnCapacity; ///< max number of launch objects held (simple model) + tcDBString maChildClass[MAX_LAUNCHER_CONFIGURATIONS]; ///< array for multiple options + UINT maCapacity[MAX_LAUNCHER_CONFIGURATIONS]; ///< array for mult configs + UINT mnConfigurations; + std::string fireControlSensorClass; ///< class of sensor on platform for fire control + ///< (track required to launch) + std::string displayName; ///< name to display in vehicle controls ! virtual const char* GetClassName() {return "Launcher";} ///< returns class name of database object ! bool IsLeaf() const; ///< returns true if db obj is a leaf obj ! virtual void PrintToFile(tcFile& file); ! int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); ! int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization ! virtual void SerializeXml(TiXmlElement* node, bool load); ///< XML serialization ! static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings ! static void AddSqlColumns(std::string& columnString); ! void ReadSql(tcSqlReader& entry); ! void WriteSql(std::string& valueString); ! tcLauncherDBObject(); ! tcLauncherDBObject(tcLauncherDBObject& obj); ///< copy constructor ! virtual ~tcLauncherDBObject(); ! }; } // namespace Database Index: tcWeaponDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcWeaponDBObject.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcWeaponDBObject.h 8 Aug 2004 00:31:32 -0000 1.3 --- tcWeaponDBObject.h 29 Nov 2004 03:54:49 -0000 1.4 *************** *** 42,45 **** --- 42,46 ---- virtual const char* GetClassName() {return "Sensor";} ///< returns class name of database object + bool IsLeaf() const; ///< returns true if db obj is a leaf obj virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); Index: tcESMDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcESMDBObject.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcESMDBObject.h 6 Nov 2004 15:13:39 -0000 1.6 --- tcESMDBObject.h 29 Nov 2004 03:54:49 -0000 1.7 *************** *** 39,42 **** --- 39,43 ---- virtual tcSensorState* CreateSensor(tcGameObject* parent); ///< factory method virtual const char* GetClassName() {return "ESM";} ///< returns class name of database object + bool IsLeaf() const; ///< returns true if db obj is a leaf obj virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); Index: tcAirDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcAirDBObject.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcAirDBObject.h 8 Aug 2004 00:31:32 -0000 1.8 --- tcAirDBObject.h 29 Nov 2004 03:54:48 -0000 1.9 *************** *** 66,69 **** --- 66,70 ---- virtual const char* GetClassName() {return "Air";} ///< returns class name of database object + bool IsLeaf() const; ///< returns true if db obj is a leaf obj void PrintToFile(tcFile& file) {} ///< not supported, redundant with CSV serialization, TODO get rid of these int Serialize(tcFile& file, bool mbLoad) {return 0;} ///< binary serialization not supported here Index: tcDatabaseObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDatabaseObject.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcDatabaseObject.h 6 Nov 2004 15:13:39 -0000 1.16 --- tcDatabaseObject.h 29 Nov 2004 03:54:49 -0000 1.17 *************** *** 106,109 **** --- 106,110 ---- #define DTYPE_BALLISTIC 11 #define DTYPE_OPTICAL 12 + #define DTYPE_STORES 13 #define DTYPE_NULL 0xFFFFFFFF *************** *** 136,139 **** --- 137,141 ---- virtual const char* GetClassName() {return "Object";} ///< returns class name of database object tc3DModel* Get3DModel(); + bool IsLeaf() const; ///< returns true if db obj is a leaf obj void Load3DModel(); void RandInit(void); Index: tcMissileDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcMissileDBObject.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcMissileDBObject.h 23 Nov 2004 23:30:32 -0000 1.13 --- tcMissileDBObject.h 29 Nov 2004 03:54:49 -0000 1.14 *************** *** 136,140 **** virtual const char* GetClassName() {return "Missile";} ///< returns class name of database object ! teWeaponLaunchMode GetLaunchMode(void); tnPoolIndex GetPrimarySeekerKey(); bool HasAllEmitters(std::vector<long>& emitters); --- 136,141 ---- virtual const char* GetClassName() {return "Missile";} ///< returns class name of database object ! bool IsLeaf() const; ///< returns true if db obj is a leaf obj ! teWeaponLaunchMode GetLaunchMode(); tnPoolIndex GetPrimarySeekerKey(); bool HasAllEmitters(std::vector<long>& emitters); Index: tcBallisticDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcBallisticDBObject.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcBallisticDBObject.h 6 Nov 2004 15:13:39 -0000 1.4 --- tcBallisticDBObject.h 29 Nov 2004 03:54:48 -0000 1.5 *************** *** 42,45 **** --- 42,46 ---- virtual const char* GetClassName() {return "Ballistic";} ///< returns class name of database object + bool IsLeaf() const; ///< returns true if db obj is a leaf obj virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); Index: tcOpticalDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcOpticalDBObject.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcOpticalDBObject.h 6 Nov 2004 15:13:39 -0000 1.1 --- tcOpticalDBObject.h 29 Nov 2004 03:54:49 -0000 1.2 *************** *** 46,49 **** --- 46,50 ---- virtual tcSensorState* CreateSensor(tcGameObject* parent); ///< factory method virtual const char* GetClassName() {return "Optical";} ///< returns class name of database object + bool IsLeaf() const; ///< returns true if db obj is a leaf obj virtual void PrintToFile(tcFile& file); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); Index: tcDBObjSerializerSql.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDBObjSerializerSql.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcDBObjSerializerSql.h 9 Aug 2004 02:35:13 -0000 1.2 --- tcDBObjSerializerSql.h 29 Nov 2004 03:54:48 -0000 1.3 *************** *** 178,183 **** { database->mcObjectData.GetNextAssoc(pos, key, dbObj); ! ! if (T* obj = dynamic_cast<T*>(dbObj)) { try --- 178,183 ---- { database->mcObjectData.GetNextAssoc(pos, key, dbObj); ! T* obj = dynamic_cast<T*>(dbObj); ! if (obj && obj->IsLeaf()) // only write leaf classes { try Index: tcFlightportDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcFlightportDBObject.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcFlightportDBObject.h 8 Aug 2004 00:31:32 -0000 1.4 --- tcFlightportDBObject.h 29 Nov 2004 03:54:49 -0000 1.5 *************** *** 59,62 **** --- 59,63 ---- virtual const char* GetClassName() {return "FlightPort";} ///< returns class name of database object + bool IsLeaf() const; ///< returns true if db obj is a leaf obj void RandInit(); int Serialize(tcFile& file, bool mbLoad, UINT32 anVersion); |