VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
powerRangeDeterminant.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2016 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
12 #include <readerWriter/rwString.h>
14 
18 {
19 public:
20 
23  static const DtString DtRangeUnused;
25 
28 
32  parentRegistry = NULL);
34  parentRegistry = NULL);
36 
40  DtReaderWriterRegistry* parentRegistry = NULL);
42  DtReaderWriterRegistry* parentRegistry = NULL);
44 
46  virtual bool operator==(const DtPowerRangeDeterminant& rhs) const;
47  bool operator!=(const DtPowerRangeDeterminant& rhs) const
48  {
49  return !(*this == rhs);
50  }
51 
53  virtual ~DtPowerRangeDeterminant();
54 
55  virtual DtPowerRangeDeterminant* clone(const DtString& name,
56  DtReaderWriterRegistry* parentRegistry = NULL) const = 0;
57  virtual DtPowerRangeDeterminant* clone(const DtSymbolString& name,
58  DtReaderWriterRegistry* parentRegistry = NULL) const = 0;
59 
62  virtual void postGetSelf();
63 
67  virtual const DtString& rangeFrom() const;
68 
70  virtual void setRangeFrom(const DtString&);
71 
73  virtual DtString powerType() const;
74 
76  virtual double detonationPower(double rangeFromShooter, double rangeFromImpact) const = 0;
77 
79  virtual double rangeFromShooterForPower(double power) const = 0;
80 
82  virtual double rangeFromImpactForPower(double power) const = 0;
83 
85  virtual double maximumRangeFromShooter() const = 0;
86 
88  virtual double maximumRangeFromImpact() const = 0;
89 
90 protected:
91 
94  virtual void validateRangeFrom() = 0;
95 
98 
109 
111 
112 };
113 
114 typedef DtPowerRangeDeterminant* (*DtPowerRangeDeterminantCreatorFcn)();
115 
118 {
119 public:
122 
125 
127  virtual void addCreatorFcn(const DtString& type, DtPowerRangeDeterminantCreatorFcn fcn);
128 
129  virtual DtPowerRangeDeterminant* createPowerRangeDeterminant(const DtString& type);
130 
131 private:
136 
137 protected:
138  typedef std::map<DtString, DtPowerRangeDeterminantCreatorFcn> DtPowerRangeDeterminantCreatorMap;
140 
141 };
bool operator==(const DtReaderWriter &) const
Equivalence operator.
static const DtString DtRangeFromImpactPoint
= &quot;shooter-to-impact&quot;
Definition: powerRangeDeterminant.h:22
This class allows one to collect and compare strings using an index number instead of having to do st...
Definition: symbolString.h:27
DtPowerRangeDeterminantCreatorMap myCreatorMap
Definition: powerRangeDeterminant.h:139
static const DtString DtRangeFromShooterToImpact
Definition: powerRangeDeterminant.h:21
#define DT_DLL_vrfobjparam
This file is used to determine how to build.
Definition: vrfobjparamDefines.h:28
virtual void postGetSelf()
Called after either version of getSelf (mtl or environment). Default is no-op.
Definition: readerWriter.h:85
Description: Readable, Writable DtString Variable substitutions are done on this object when it is re...
Definition: rwString.h:20
bool operator!=(const DtPowerRangeDeterminant &rhs) const
Definition: powerRangeDeterminant.h:47
Definition: readerWriterRegistry.h:39
static const DtString DtRangeUnused
= &quot;impact-point&quot;
Definition: powerRangeDeterminant.h:23
A readable/writable object that indicates the power of a detonation of a given type, potentially at different ranges from the point of impact.
Definition: powerRangeDeterminant.h:17
DtPowerRangeDeterminant *(* DtPowerRangeDeterminantCreatorFcn)()
Definition: powerRangeDeterminant.h:114
std::map< DtString, DtPowerRangeDeterminantCreatorFcn > DtPowerRangeDeterminantCreatorMap
Definition: powerRangeDeterminant.h:138
Factory for creating power range determinants.
Definition: powerRangeDeterminant.h:117
const DtReaderWriter & operator=(const DtReaderWriter &orig)
assignment operator
DtRwString myRangeFrom
Parameter Name: range-from Parameter Description: The determinant will determine the power based on t...
Definition: powerRangeDeterminant.h:108
static const DtString DtRangeFromShooterAndImpact
= &quot;unused&quot;
Definition: powerRangeDeterminant.h:24

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)