![]() |
VR-Forces 4.1.1 Class Documentation
|
File: munLoader.h. More...

Public Member Functions | |
| DtVrfMunitionLoader (const DtString &rwName=DtString::nullString(), DtReaderWriterRegistry *parentRegistry=0) | |
| DtVrfMunitionLoader (const DtVrfMunitionLoader &orig, const DtString &rwName=DtString::nullString(), DtReaderWriterRegistry *parentRegistry=0) | |
| const DtVrfMunitionLoader & | operator= (const DtVrfMunitionLoader &orig) |
| virtual | ~DtVrfMunitionLoader () |
| virtual void | tick (const DtSimMunition &correctMunition, DtDetonatorFuze correctFuze, DtTime currentTime, int roundsAvailable=1) |
| Tick the munition loader to update the load state. | |
| virtual void | load (DtTime startLoadTime, const DtSimMunition &munition, DtDetonatorFuze fuze) |
| Sets the loading state to Loading. | |
| virtual void | loadComplete (int roundsAvailable) |
| Sets the loading state to Loaded. | |
| virtual void | unload (DtTime startUnloadTime) |
| Sets the load state to Unloaded, and the number of rounds currently in the magazine to zero. | |
| virtual void | unload () |
| Unload without a timer. Called when munition is fired. | |
| virtual bool | isLoading () const |
| myState == Loading | |
| virtual bool | isUnLoading () const |
| myState == Unloading | |
| virtual bool | isLoaded () const |
| myState == Loaded | |
| virtual bool | isUnloaded () const |
| myState == Unloaded This is included for completeness, but typically the user will want to use if (! isLoaded()) rather than (isUnloaded()) as the former is the one that tells you that the gun isn't ready to shoot yet | |
| virtual const DtSimMunition & | currentMunition () const |
| virtual void | setCurrentMunition (const DtSimMunition ¤tMunition) |
| virtual DtDetonatorFuze | currentFuze () const |
| virtual void | setCurrentFuze (DtDetonatorFuze currentFuze) |
| virtual double | completeLoadTime () const |
| CompleteLoadTime is normally set by the load() method, and sets the exercise time that a load operation will complete. | |
| virtual void | setCompleteLoadTime (double completeLoadTime) |
| virtual double | completeUnloadTime () const |
| CompleteUnloadTime is normally set by the unload() method, and sets the exercise time that an unload operation will complete. | |
| virtual void | setCompleteUnloadTime (double completeUnloadTime) |
| virtual double | loadAmmoTime () const |
| Called by the controller based on the value in the descriptor. | |
| virtual void | setLoadAmmoTime (double loadAmmoTime) |
| Called by the controller based on the value in the descriptor. | |
| virtual double | unloadAmmoTime () const |
| Called by the controller based on the value in the descriptor. | |
| virtual void | setUnloadAmmoTime (double unloadAmmoTime) |
| Called by the controller based on the value in the descriptor. | |
| virtual void | setRoundsPerMagazine (const int nRounds) |
| Called by the actuator, which sets value based on descriptor. | |
| virtual int | roundsPerMagazine () const |
| virtual int | roundsLeftInMagazine () const |
| Returns number of rounds left in magazine (rounds to fire before becoming unloaded) | |
| virtual void | useRounds (const int nRounds) |
| Deplete the rounds left. Called by actuator when it fires. | |
| virtual void | setConsoleWarn (DtOutputStream *const warnStream) |
| Set object output consoles for the munition loader so that debug messages can be output. | |
| virtual void | setConsoleDebug (DtOutputStream *const debugStream) |
Public Member Functions inherited from DtReaderWriter | |
| DtReaderWriter () | |
| default constructor | |
| DtReaderWriter (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false) | |
| real constructor Setting the readonly flag prevents object from writing itself to the stream. | |
| DtReaderWriter (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false) | |
| DtReaderWriter (const DtString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL) | |
| copy constructor | |
| DtReaderWriter (const DtSymbolString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL) | |
| const DtReaderWriter & | operator= (const DtReaderWriter &orig) |
| assignment operator | |
| virtual | ~DtReaderWriter () |
| destructor | |
| virtual void | putSelf (FILE *fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename()) |
| Top level call to write itself to file. | |
| virtual void | getSelf (DtlObjPtr args, const DtFilename &searchPath=DtFilename::nullFilename(), const DtVariableBindingsList &variableBindings=nullVariableReference()) |
| Top level to read itself from an input stream. | |
| virtual void | writeSelf (FILE *fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename()) |
| Called from putSelf, calls myRegistry.putSelf which in turn calls putSelf on each reader/writer in the registry. | |
| virtual DtSymbolString | name () const |
| Accessor for name of this readable/writable object. | |
| virtual void | addAlias (const DtSymbolString &alias) |
| Add an alias as an alternative name for this object. | |
| virtual bool | hasAlias (const DtSymbolString &alias) |
| virtual const aliasContainer & | aliases () const |
| virtual void | setReadonly (bool flag) |
| Set read-only flag. | |
| virtual bool | isReadonly () const |
| virtual bool | variableIsBound () const |
| virtual void | unbindVariable () |
| Sets the myVariableIsBound flag to false. | |
| virtual void | setName (const DtString &) |
| Set the name of the object. | |
| virtual const char * | readerWriterType () const |
| Used to supply a string type that this reader writer type is. | |
| virtual DtString | prettyPrint () const |
| Routine to return a human readable form of the reader/writer variable. | |
| virtual void | bindVariables (DtVariableBindingsList variableBindings) |
| Runs a variable binding pass on this reader writer and any of its children. | |
| virtual std::list < DtVariableNameType > | unboundVariables () const |
| bool | invalid () const |
| virtual bool | hasChild (const DtReaderWriter *p) const |
| Returns true if this variable has a child p in it's chain. | |
| virtual void | setValueSpecified (bool specified, bool recurse=false) |
| The specified flags are used for optional values. | |
| virtual bool | valueSpecified () const |
| The specified flags are used for optional values. | |
| virtual bool | isVariableReference () const |
| Specifies whether or not this reader writer is really a variable that is specified elsewhere. | |
| virtual void | setIsVariableReference (bool value) |
| virtual DtSymbolString | variableName () const |
| The variable name, if this object is a variable reference. | |
| virtual void | setVariableName (const DtSymbolString variableName) |
| The variable name, if this object is a variable reference. | |
| const DtReaderWriterRegistry & | registry () const |
| Collection of child DtReaderWriter nodes owned by this object. | |
| DtReaderWriterRegistry & | registry () |
| Collection of child DtReaderWriter nodes owned by this object. | |
Protected Types | |
| enum | LoadState { Loading, Unloading, Unloaded, Loaded } |
Protected Attributes | |
| DtRwInt | myState |
| DtOutputStream * | myConsoleWarn |
| DtOutputStream * | myConsoleDebug |
| DtSimMunition | myCurrentMunition |
| The munition and fuze currently loaded / loading. | |
| DtRwInt | myCurrentFuze |
| DtRwReal | myCompleteLoadTime |
| DtRwReal | myCompleteUnloadTime |
| DtReal | myLoadAmmoTime |
| Fed from controller based on the value from the descriptor. | |
| DtReal | myUnloadAmmoTime |
| Fed from controller based on the value from the descriptor. | |
| DtRwInt | myRoundsPerMagazine |
| How many rounds the magazine holds; loader loads a magazine at a time. | |
| DtRwInt | myRoundsLeftInMagazine |
| How many rounds left to be fired before becoming unloaded. | |
Protected Attributes inherited from DtReaderWriter | |
| const DtSymbolString | myName |
| DtReaderWriterRegistry | myRegistry |
| bool | myValueSpecified |
| bool | myReadOnlyFlag |
| bool | myIsVariableReference |
| DtSymbolString | myVariableName |
| bool | myVariableIsBound |
| aliasContainer | myAliases |
| Container for the aliases which represent alternative names for the object. | |
| bool | myInvalid |
| Set to true if there is a problem reading this item. | |
Additional Inherited Members | |
Public Types inherited from DtReaderWriter | |
| typedef std::vector < DtSymbolString > | aliasContainer |
| typedef std::vector < DtSymbolString >::iterator | aliasIter |
| typedef std::vector < DtSymbolString > ::const_iterator | aliasConstIter |
| typedef std::pair < DtSymbolString, DtString > | DtVariableNameType |
Static Public Member Functions inherited from DtReaderWriter | |
| static void | putIndent (FILE *fp, int indentLevel) |
| static const DtVariableBindingsList & | nullVariableReference () |
| static void | setPostGetSelfCallback (DtGetSelfCallbackFcn fcn, void *usrData) |
| static void | setPrePutSelfCallback (DtPutSelfCallbackFcn fcn, void *usrData) |
| static const DtFilename & | appPath () |
| Gets the current working directory. | |
| static DtReaderWriterFactory * | factory () |
Protected Member Functions inherited from DtReaderWriter | |
| virtual void | bindToRwAsVariable (const DtReaderWriter *rw) |
| Copies values from the specified DtReaderWriter. | |
| virtual void | bindLocalVariables (const DtVariableBindingsList &variableBindings) |
| Checks to see if this RW object is a variable reference that can be bound using the provided bindings. | |
| virtual void | putData (FILE *fp, int indentLevel=0) |
| Deriving class overrides these to get/put class specific data. | |
| virtual DtlObjPtr | getData (DtlObjPtr args, const DtFilename &searchPath, const DtVariableBindingsList &variableBindings) |
| Deriving class overrides these to get/put class specific data. | |
Static Protected Attributes inherited from DtReaderWriter | |
| static DtString | theUnspecifiedValue |
| static DtGetSelfCallbackInfo | thePostGetSelfCallback |
| static DtPutSelfCallbackInfo | thePrePutSelfCallback |
| static const DtVariableBindingsList | theEmptyVariableBindingsList |
| static DtReaderWriterFactory | theFactory |
File: munLoader.h.
Class: DtVrfMunitionLoader Class DtVrfMunitionLoader:
|
protected |
| DtVrfMunitionLoader::DtVrfMunitionLoader | ( | const DtString & | rwName = DtString::nullString(), |
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) |
| DtVrfMunitionLoader::DtVrfMunitionLoader | ( | const DtVrfMunitionLoader & | orig, |
| const DtString & | rwName = DtString::nullString(), |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) |
|
virtual |
| const DtVrfMunitionLoader& DtVrfMunitionLoader::operator= | ( | const DtVrfMunitionLoader & | orig | ) |
|
virtual |
Tick the munition loader to update the load state.
The munition and fuze arguments indicate the correct load for the current target; if the loader is not loaded with or loading this munition, it will begin doing so. If the gun loads magazines of ammo at a time, the rounds available argument will make sure that the loader doesn't load more rounds than are available.
|
virtual |
Sets the loading state to Loading.
Also remembers what munition and fuze is being loaded so loader can compare to the values in the next tick call.
|
virtual |
Sets the loading state to Loaded.
Loads the gun with a number of rounds equal to RoundsPerMagazine, if there are that many available (or otherwise what is available). If there is no ammo in the resource database, the loader refuses to load.
|
virtual |
Sets the load state to Unloaded, and the number of rounds currently in the magazine to zero.
|
virtual |
Unload without a timer. Called when munition is fired.
|
virtual |
myState == Loading
|
virtual |
myState == Unloading
|
virtual |
myState == Loaded
|
virtual |
myState == Unloaded This is included for completeness, but typically the user will want to use if (! isLoaded()) rather than (isUnloaded()) as the former is the one that tells you that the gun isn't ready to shoot yet
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
CompleteLoadTime is normally set by the load() method, and sets the exercise time that a load operation will complete.
|
virtual |
|
virtual |
CompleteUnloadTime is normally set by the unload() method, and sets the exercise time that an unload operation will complete.
|
virtual |
|
virtual |
Called by the controller based on the value in the descriptor.
|
virtual |
Called by the controller based on the value in the descriptor.
|
virtual |
Called by the controller based on the value in the descriptor.
|
virtual |
Called by the controller based on the value in the descriptor.
|
virtual |
Called by the actuator, which sets value based on descriptor.
Needed by the loader so it knows how many rounds to load at once.
|
virtual |
|
virtual |
Returns number of rounds left in magazine (rounds to fire before becoming unloaded)
|
virtual |
Deplete the rounds left. Called by actuator when it fires.
|
virtual |
Set object output consoles for the munition loader so that debug messages can be output.
|
virtual |
|
protected |
|
protected |
|
protected |
|
protected |
The munition and fuze currently loaded / loading.
If these do not match the values passed in to tick, a load (or unload/load) sequence is initiated
|
protected |
|
protected |
|
protected |
|
protected |
Fed from controller based on the value from the descriptor.
|
protected |
Fed from controller based on the value from the descriptor.
|
protected |
How many rounds the magazine holds; loader loads a magazine at a time.
Set by gun (actuator) using parameter values in the descriptor.
|
protected |
How many rounds left to be fired before becoming unloaded.