[Gcblue-commits] gcb_wx/include/database tcSensorPlatformDBObject.h,NONE,1.1 tcDatabase.h,1.9,1.10 t
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-03-04 00:46:58
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11821/include/database Modified Files: tcDatabase.h tcGenericDBObject.h Added Files: tcSensorPlatformDBObject.h Log Message: Better sensor ageout behavior, more ai work, misc cleanup Index: tcGenericDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcGenericDBObject.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcGenericDBObject.h 31 Jan 2005 01:32:35 -0000 1.16 --- tcGenericDBObject.h 4 Mar 2005 00:46:14 -0000 1.17 *************** *** 28,31 **** --- 28,32 ---- #include "tcDatabaseObject.h" + #include "tcSensorPlatformDBObject.h" #include <vector> #include "tc3DPoint.h" *************** *** 46,50 **** * for a simple surface ship or aircraft model. */ ! class tcGenericDBObject : public tcDatabaseObject { public: --- 47,53 ---- * for a simple surface ship or aircraft model. */ ! class tcGenericDBObject : ! public tcDatabaseObject, ! public tcSensorPlatformDBObject { public: *************** *** 52,56 **** { MAXLAUNCHERS = 10, - MAXSENSORS = 8, MAXANIMATIONS = 4, MAXMAGAZINES = 3 --- 55,58 ---- *************** *** 73,87 **** int mnNumLaunchers; int mnNumMagazines; ! int mnNumSensors; tcDBString maLauncherClass[MAXLAUNCHERS]; tcDBString maMagazineClass[MAXMAGAZINES]; - tcDBString maSensorClass[MAXSENSORS]; - std::vector<long> sensorId; ///< database id's of sensors std::vector<std::string> launcherName; ///< display names of launchers, e.g. "Tube 1" - float sensorAz[MAXSENSORS]; ///< pointing angles of sensors in degrees - - tcDBString flightportClass; ///< database class name of flightport (or empty if none) std::vector<animationDBInfo> animationInfo; --- 75,84 ---- int mnNumLaunchers; int mnNumMagazines; ! tcDBString maLauncherClass[MAXLAUNCHERS]; tcDBString maMagazineClass[MAXMAGAZINES]; std::vector<std::string> launcherName; ///< display names of launchers, e.g. "Tube 1" tcDBString flightportClass; ///< database class name of flightport (or empty if none) std::vector<animationDBInfo> animationInfo; *************** *** 93,97 **** float GetLauncherAz(unsigned n); tc3DPoint GetLauncherPosition(unsigned n); ! bool HasAllEmitters(std::vector<long>& emitters); void RandInit(); virtual void PrintToFile(tcFile& file); --- 90,94 ---- float GetLauncherAz(unsigned n); tc3DPoint GetLauncherPosition(unsigned n); ! void RandInit(); virtual void PrintToFile(tcFile& file); *************** *** 109,114 **** virtual ~tcGenericDBObject(); - private: - void UpdateSensorList(); }; --- 106,109 ---- --- NEW FILE: tcSensorPlatformDBObject.h --- /** ** @file tcSensorPlatformDBObject.h */ /* Copyright (C) 2005 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 _SENSORPLATFORMDBOBJECT_H_ #define _SENSORPLATFORMDBOBJECT_H_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include <vector> class TiXmlElement; class tcFile; namespace Database { class tcDatabase; class tcSqlReader; class CsvTranslator; /** * Sensor info for platform */ class tcSensorPlatformDBObject { public: enum { MAXSENSORS = 8 ///< number of sensor entries supported in database }; std::vector<std::string> sensorClass; std::vector<long> sensorId; ///< database id's of sensors std::vector<float> sensorAz; ///< pointing angles of sensors in degrees virtual const char* GetClassName() {return "Generic";} ///< returns class name of database object bool HasAllEmitters(std::vector<long>& emitters); void PrintToFile(tcFile& file); int SerializeCSV(CsvTranslator* csv, bool mbLoad); ///< CSV serialization void SerializeXml(TiXmlElement* node, bool load); ///< XML serialization void ReadSql(tcSqlReader& entry); void WriteSql(std::string& valueString); static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings static void AddSqlColumns(std::string& columnString); tcSensorPlatformDBObject(); tcSensorPlatformDBObject(tcSensorPlatformDBObject& obj); ///< copy constructor virtual ~tcSensorPlatformDBObject(); private: void UpdateSensorList(); }; } #endif Index: tcDatabase.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDatabase.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcDatabase.h 6 Nov 2004 15:13:39 -0000 1.9 --- tcDatabase.h 4 Mar 2005 00:46:14 -0000 1.10 *************** *** 84,88 **** 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); --- 84,88 ---- int GetObject(tnPoolIndex anKey, tcDatabaseObject*& rpobj); tcDatabaseObject* GetObject(tnPoolIndex anKey); ! tcDatabaseObject* GetObject(const std::string& className); ///< gets object by class name int GetObjectClass(tnPoolIndex anKey, tcDBString& rzClass); tnPoolIndex GetFirstObjectOfClass(UINT anClassID); *************** *** 96,100 **** void LoadDBCSV(std::string suffix = ""); void SaveDBCSV(std::string suffix = ""); ! void LoadDBXml(std::string suffix = ""); void SaveDBXml(std::string suffix = ""); void RandomizePlatforms(); --- 96,101 ---- void LoadDBCSV(std::string suffix = ""); void SaveDBCSV(std::string suffix = ""); ! void LoadDBXml(std::string suffix = ""); ! void SaveDBXml(std::string suffix = ""); void RandomizePlatforms(); |