Update of /cvsroot/gcblue/gcb_wx/include/database
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11430/include/database
Modified Files:
tcDatabaseObject.h
Added Files:
tcECMDBObject.h
Log Message:
Index: tcDatabaseObject.h
===================================================================
RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDatabaseObject.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** tcDatabaseObject.h 22 Mar 2006 01:23:28 -0000 1.27
--- tcDatabaseObject.h 23 Mar 2006 01:12:11 -0000 1.28
***************
*** 142,145 ****
--- 142,146 ----
static void AttachDatabase(tcDatabase *db) {database = db;}
virtual const char* GetClassName() {return "Object";} ///< returns class name of database object
+ float GetCost() const {return cost;}
const char* GetCostString() const; ///< return cost as string
virtual tc3DModel* Copy3DModel(); ///< creates copy of model (must be deleted)
***************
*** 160,164 ****
void WriteSql(std::string& valueString);
!
static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings
--- 161,165 ----
void WriteSql(std::string& valueString);
! static const char* CostToString(float cost_);
static int WriteCSVHeader(CsvTranslator* csv); ///< writes column headings
--- NEW FILE: tcECMDBObject.h ---
/**
** @file tcECMDBObject.h
*/
/* Copyright (C)2006 Dewitt Colclough (de...@gc...)
** 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 _ECMDBOBJECT_H_
#define _ECMDBOBJECT_H_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "tcSensorDBObject.h"
#include "database/tcSqlReader.h"
namespace database
{
class tcSqlReader;
/**
* Electronic Counter Measures (ECM) modeled as type of "sensor" object
*/
class tcECMDBObject : public tcSensorDBObject
{
public:
std::string ecmType; ///< "Jammer" "Deception"
float ERP_dBW; ///< [dBW] effective radiated power (assume bandwidth matched to target radars)
float effectivenessRating; ///< 0 - 1.0
bool isEffectiveVsSurveillance;
bool isEffectiveVsSeeker;
virtual tcSensorState* CreateSensor(tcGameObject* parent); ///< factory method
virtual const char* GetClassName() {return "ECM";} ///< 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
tcECMDBObject();
tcECMDBObject(tcECMDBObject& obj); ///< copy constructor
virtual ~tcECMDBObject();
static void AddSqlColumns(std::string& columnString);
void ReadSql(tcSqlReader& entry);
void WriteSql(std::string& valueString);
};
} // namespace database
#endif
|