25 class DtSimResourceFactory;
43 virtual void getSelf(DtlObjPtr args,
63 parentRegistry = NULL);
66 parentRegistry = NULL);
87 virtual const char*
xmlType()
const override
97 virtual void deplete(
double d = 1);
100 virtual bool matches(
const std::vector<DtEntityType>&)
const;
102 virtual void setResourceType(
const DtEntityType&);
108 virtual void setCurrentAmount(
double amount);
114 double currentAmount()
const;
118 return currentAmount();
121 virtual void setValueIsInteger(
bool);
124 return myValueIsInteger;
127 virtual void setFullAmount(
double amount);
128 double fullAmount()
const;
130 virtual void setRestore(
bool);
136 virtual void restore();
138 virtual int netRepSize()
const;
141 virtual const char* setFromNet(
const char* contentBuffer);
146 virtual void addUpdateCallback(UpdateCallback fcn,
void* usrData);
149 virtual void removeUpdateCallback(UpdateCallback fcn,
void* usrData);
152 virtual void callUpdateCallbacks();
157 virtual char* setToNet(
char* contentBuffer)
const;
160 virtual double percentageFull()
const;
164 return myCurrentAmount;
169 return myCurrentAmount;
207 virtual void setBin(
int);
209 virtual void clearFullAmount();
221 virtual void setDisplayName(
const DtString&);
224 return myDisplayName;
239 int myValueIsInteger =
false;
246 return !(*
this == orig);
bool operator==(const DtReaderWriter &) const
Equivalence operator.
virtual const char * readerWriterType() const
Used to supply a string type that this reader writer type is. This can be used in place of dynamic-ca...
This class allows one to collect and compare strings using an index number instead of having to do st...
Definition: symbolString.h:27
virtual void postGetSelf()
Called after either version of getSelf (mtl or environment). Default is no-op.
DtRwReal & fullAmountVariable()
Definition: simResource.h:177
virtual const char * xmlType() const override
Definition: simResource.h:87
Definition: simResource.h:37
Definition: readerWriter.h:85
The DtSimResourceManager is responsible for managing all of the resources for a given entity...
Definition: simResourceManager.h:18
RwMunitionOrEntityType myResource
Definition: simResource.h:232
Definition: readerWriterRegistry.h:39
virtual DtString prettyPrint() const
Routine to return a human readable form of the reader/writer variable. Not all reader/writer classes ...
void setAmmunitionName(const DtString &s)
Definition: simResource.h:49
bool operator!=(const DtSimResource &orig) const
Expects subclasses to implement isEqual method. Default returns false.
Definition: simResource.h:244
bool shouldRestore() const
Definition: simResource.h:131
DtRwEntityType & operator=(const DtRwEntityType &orig)
assignment: assigns value only
bool operator!=(const DtReaderWriter &rhs) const
Definition: readerWriter.h:121
DtRwReal myFullAmount
Definition: simResource.h:234
const DtString & displayName() const
This is only used locally in the GUI. It is not sent over the network nor saved anywhere. If creating this resource in code in the GUI and you want to display this name rather than a name based on the entity type, set this here. Set to the empty string to revert to using the name returned by the enumerations dictionary.
Definition: simResource.h:222
std::list< const DtRwVariableBindings * > DtVariableBindingsList
Definition: readerWriterRegistry.h:29
void setAmount(double a)
Definition: simResource.h:109
Description: Readable, Writable int.
Definition: rwInt.h:25
DtCallbackList< DtSimResource * > myUpdateCallbacks
Definition: simResource.h:238
std::vector< DtFilename > SearchPaths
Definition: readerWriter.h:92
const DtRwInt & binVariable() const
Definition: simResource.h:192
const DtRwReal & fullAmountVariable() const
Definition: simResource.h:172
DtRwBoolean & restoreVariable()
Definition: simResource.h:187
virtual void getSelf(DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
Top level to read itself from an input stream. searchPath is passed down to all DtReaderWriter member...
DtRwBoolean myRestore
Definition: simResource.h:235
int bin() const
Definition: simResource.h:202
DtRwInt & binVariable()
Definition: simResource.h:197
Description: Readable, Writable DtReal (double)
Definition: rwReal.h:27
File: rwEntType.h.
Definition: rwEntityType.h:26
DtRwReal & currentAmountVariable()
Definition: simResource.h:167
bool valueIsInteger() const
Definition: simResource.h:122
Description: Readable, Writable bool.
Definition: rwBoolean.h:26
DtString myDisplayName
Definition: simResource.h:241
DtEntityType & operator=(const DtEntityType &t)
Definition: simResource.h:47
DtSimResource is a class which will define a SISO Enumeration to use as a resource and the quantity o...
Definition: simResource.h:32
DtRwInt myBin
Definition: simResource.h:236
DtRwReal myCurrentAmount
Definition: simResource.h:233
#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
const DtEntityType & resourceType() const
Definition: simResource.h:103
static const char * theXmlType()
The type that is used when archiving to an XML stream.
const DtRwBoolean & restoreVariable() const
Definition: simResource.h:182
double amount() const
Definition: simResource.h:116
const DtRwReal & currentAmountVariable() const
Definition: simResource.h:162