VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
rwHazardAreaInformation.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2013 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 
8 
9 #pragma once
10 
11 #include "vrfutil/vrfutilDefines.h"
15 #include "vrfutil/rwEntityType.h"
17 #include <readerWriter/rwString.h>
18 #include <readerWriter/rwInt.h>
19 
27 
29 class DtRwHazardType;
31 
34 {
35 public:
36 
39 
41  DtRwHazardType(const DtString& name, DtReaderWriterRegistry* const parentRegistry = NULL);
42 
44  virtual ~DtRwHazardType();
45 
47  DtRwHazardType(const DtString& name,
48  const DtRwHazardType& orig,
49  DtReaderWriterRegistry* const parentRegistry = NULL);
50 
53 
54  virtual void setHazardType(const DtEntityType&);
55  virtual const DtEntityType& hazardType() const;
56 
57  virtual void setDescription(const DtString&);
58  virtual const DtString& description() const;
59 
60  virtual void setDamagePerSecond(int);
61  virtual const int damagePerSecond() const;
62 
63  virtual void setMinimumMOPP(int);
64  virtual const int minimumMOPP() const;
65 
69  virtual const char* readerWriterType() const;
70 
72  static const char* theXmlType();
73 
74  virtual const char* xmlType() const
75  {
76  return theXmlType();
77  }
78 
80  bool operator==(const DtRwHazardType&) const;
81  bool operator!=(const DtRwHazardType& rhs) const { return !(*this == rhs); };
82 
83 protected:
84  DtRwEntityType myHazardType;
88 };
89 
90 class DT_DLL_vrfutil DtRwHazardTypes : public DtRwTemplatedListPtr<DtRwHazardType,true>
91 {
92 public:
93 
96 
98  DtRwHazardTypes(const DtString& name, DtReaderWriterRegistry* parentRegistry = NULL);
99  DtRwHazardTypes(const DtSymbolString& name, DtReaderWriterRegistry* parentRegistry = NULL);
100 
101 public:
103  virtual void removeHazardType(DtRwHazardType*);
104 
107  virtual DtListItem* add(DtReaderWriter* data);
108 
111  virtual DtListItem* addWithAlternateName(DtReaderWriter* data, const DtString& name);
112 
115  virtual DtListItem* addToStart(DtReaderWriter* data);
116 
119  virtual DtListItem* addToEnd(DtReaderWriter* data);
120 };
121 
123 {
124 public:
125 
128 
130  DtRwHazardAreaInformation(const DtString& name, DtReaderWriterRegistry* const parentRegistry = NULL);
131 
133  virtual ~DtRwHazardAreaInformation();
134 
136  DtRwHazardAreaInformation(const DtString& name,
137  const DtRwHazardAreaInformation& orig,
138  DtReaderWriterRegistry* const parentRegistry = NULL);
139 
142 
144  bool operator==(const DtRwHazardAreaInformation&) const;
145  bool operator!=(const DtRwHazardAreaInformation& rhs) const { return !(*this == rhs); };
146 
148  virtual void clear();
149 
152  virtual bool load(const DtFilename&);
153 
155  virtual bool save() const;
156 
158  virtual bool save(const DtFilename&) const;
159 
163  virtual const char* readerWriterType() const;
164 
166  static const char* theXmlType();
167 
168  virtual const char* xmlType() const
169  {
170  return theXmlType();
171  }
172 
175  virtual const DtRwHazardTypes& hazardTypes() const;
176  virtual DtRwHazardTypes& hazardTypes();
178 
180  const std::vector<DtRwHazardType> hazardTypesFor(const DtEntityType&) const;
181 
183  virtual DtString mapAgentTypeToDescription(const DtEntityType& t, const DtString& agentType) const;
184 
187  virtual const DtRwTemplatedStringList& terrainTypes() const;
188  virtual DtRwTemplatedStringList& terrainTypes();
189 
191  virtual DtString mapTerrainTypeToDescription(const DtString& type) const;
193 
196  virtual const DtRwTemplatedStringList& topographyTypes() const;
197  virtual DtRwTemplatedStringList& topographyTypes();
198 
200  virtual DtString mapTopographyTypeToDescription(const DtString& type) const;
202 
205  virtual const DtRwTemplatedStringList& vegetationTypes() const;
206  virtual DtRwTemplatedStringList& vegetationTypes();
207 
209  virtual DtString mapVegetationTypeToDescription(const DtString& type) const;
211 
212 protected:
217 
218  DtFilename myFilename;
219 };
bool operator==(const DtReaderWriter &) const
Equivalence operator.
virtual DtListItem * addToStart(DtReaderWriter *data)
Add element to the beginning of the list.
virtual const char * readerWriterType() const
Used to supply a string type that this reader writer type is.
virtual const char * xmlType() const
Definition: rwHazardAreaInformation.h:168
Definition: symbolString.h:20
virtual DtListItem * addWithAlternateName(DtReaderWriter *data, const DtString &name)
Add element to the end of the list, but use the provided name in place of the object name on the data...
A hazard type contains hazard area information and the type it applies to.
Definition: rwHazardAreaInformation.h:33
DtRwString myDescription
Definition: rwHazardAreaInformation.h:85
Definition: readerWriter.h:85
Description: Readable, Writable DtString Variable substitutions are done on this object when it is re...
Definition: rwString.h:20
DtFilename myFilename
Definition: rwHazardAreaInformation.h:218
DtRwTemplatedStringList myVegetationTypes
Definition: rwHazardAreaInformation.h:216
Definition: readerWriterRegistry.h:39
Definition: rwHazardAreaInformation.h:122
virtual DtListItem * add(T *data)
Define this function to hide the DtRwList version, and accept only the specific DtReaderWriter subcla...
Definition: rwTemplatedList.h:60
Definition: rwHazardAreaInformation.h:90
DtRwInt myMinimumMOPP
Definition: rwHazardAreaInformation.h:87
DtRwHazardTypes myHazardTypes
Definition: rwHazardAreaInformation.h:213
Description: Readable, Writable int.
Definition: rwInt.h:25
DtRwTemplatedStringList myTopographyTypes
Definition: rwHazardAreaInformation.h:215
bool operator!=(const DtRwHazardAreaInformation &rhs) const
Definition: rwHazardAreaInformation.h:145
virtual const char * xmlType() const
Definition: rwHazardAreaInformation.h:74
File: rwEntType.h.
Definition: rwEntityType.h:23
Definition: rwTemplatedList.h:133
bool operator!=(const DtRwHazardType &rhs) const
Definition: rwHazardAreaInformation.h:81
virtual DtListItem * addToEnd(DtReaderWriter *data)
Add element to the end of the list.
A version of DtRwList that contains a homogeneous list of a templated RW type.
Definition: rwTemplatedList.h:26
#define DT_DLL_vrfutil
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfutilDefines.h:34
const DtReaderWriter & operator=(const DtReaderWriter &orig)
assignment operator
static const char * theXmlType()
The type that is used when archiving to an XML stream.
DtRwTemplatedStringList myTerrainTypes
Definition: rwHazardAreaInformation.h:214
DtRwInt myDamagePerSecond
Definition: rwHazardAreaInformation.h:86

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)