![]() |
VR-Forces 4.0.4 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) |
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. | |
File: munLoader.h.
Class: DtVrfMunitionLoader Class DtVrfMunitionLoader:
enum DtVrfMunitionLoader::LoadState [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 DtVrfMunitionLoader::~DtVrfMunitionLoader | ( | ) | [virtual] |
| const DtVrfMunitionLoader& DtVrfMunitionLoader::operator= | ( | const DtVrfMunitionLoader & | orig | ) |
| virtual void DtVrfMunitionLoader::tick | ( | const DtSimMunition & | correctMunition, |
| DtDetonatorFuze | correctFuze, | ||
| DtTime | currentTime, | ||
| int | roundsAvailable = 1 |
||
| ) | [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 void DtVrfMunitionLoader::load | ( | DtTime | startLoadTime, |
| const DtSimMunition & | munition, | ||
| DtDetonatorFuze | fuze | ||
| ) | [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 void DtVrfMunitionLoader::loadComplete | ( | int | roundsAvailable | ) | [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 void DtVrfMunitionLoader::unload | ( | DtTime | startUnloadTime | ) | [virtual] |
Sets the load state to Unloaded, and the number of rounds currently in the magazine to zero.
| virtual void DtVrfMunitionLoader::unload | ( | ) | [virtual] |
Unload without a timer. Called when munition is fired.
| virtual bool DtVrfMunitionLoader::isLoading | ( | ) | const [virtual] |
myState == Loading
| virtual bool DtVrfMunitionLoader::isUnLoading | ( | ) | const [virtual] |
myState == Unloading
| virtual bool DtVrfMunitionLoader::isLoaded | ( | ) | const [virtual] |
myState == Loaded
| virtual bool DtVrfMunitionLoader::isUnloaded | ( | ) | const [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 const DtSimMunition& DtVrfMunitionLoader::currentMunition | ( | ) | const [virtual] |
| virtual void DtVrfMunitionLoader::setCurrentMunition | ( | const DtSimMunition & | currentMunition | ) | [virtual] |
| virtual DtDetonatorFuze DtVrfMunitionLoader::currentFuze | ( | ) | const [virtual] |
| virtual void DtVrfMunitionLoader::setCurrentFuze | ( | DtDetonatorFuze | currentFuze | ) | [virtual] |
| virtual double DtVrfMunitionLoader::completeLoadTime | ( | ) | const [virtual] |
CompleteLoadTime is normally set by the load() method, and sets the exercise time that a load operation will complete.
| virtual void DtVrfMunitionLoader::setCompleteLoadTime | ( | double | completeLoadTime | ) | [virtual] |
| virtual double DtVrfMunitionLoader::completeUnloadTime | ( | ) | const [virtual] |
CompleteUnloadTime is normally set by the unload() method, and sets the exercise time that an unload operation will complete.
| virtual void DtVrfMunitionLoader::setCompleteUnloadTime | ( | double | completeUnloadTime | ) | [virtual] |
| virtual double DtVrfMunitionLoader::loadAmmoTime | ( | ) | const [virtual] |
Called by the controller based on the value in the descriptor.
| virtual void DtVrfMunitionLoader::setLoadAmmoTime | ( | double | loadAmmoTime | ) | [virtual] |
Called by the controller based on the value in the descriptor.
| virtual double DtVrfMunitionLoader::unloadAmmoTime | ( | ) | const [virtual] |
Called by the controller based on the value in the descriptor.
| virtual void DtVrfMunitionLoader::setUnloadAmmoTime | ( | double | unloadAmmoTime | ) | [virtual] |
Called by the controller based on the value in the descriptor.
| virtual void DtVrfMunitionLoader::setRoundsPerMagazine | ( | const int | nRounds | ) | [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 int DtVrfMunitionLoader::roundsPerMagazine | ( | ) | const [virtual] |
| virtual int DtVrfMunitionLoader::roundsLeftInMagazine | ( | ) | const [virtual] |
Returns number of rounds left in magazine (rounds to fire before becoming unloaded)
| virtual void DtVrfMunitionLoader::useRounds | ( | const int | nRounds | ) | [virtual] |
Deplete the rounds left. Called by actuator when it fires.
| virtual void DtVrfMunitionLoader::setConsoleWarn | ( | DtOutputStream *const | warnStream | ) | [virtual] |
Set object output consoles for the munition loader so that debug messages can be output.
| virtual void DtVrfMunitionLoader::setConsoleDebug | ( | DtOutputStream *const | debugStream | ) | [virtual] |
DtRwInt DtVrfMunitionLoader::myState [protected] |
DtOutputStream* DtVrfMunitionLoader::myConsoleWarn [protected] |
DtOutputStream* DtVrfMunitionLoader::myConsoleDebug [protected] |
DtSimMunition DtVrfMunitionLoader::myCurrentMunition [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
DtRwInt DtVrfMunitionLoader::myCurrentFuze [protected] |
DtRwReal DtVrfMunitionLoader::myCompleteLoadTime [protected] |
DtRwReal DtVrfMunitionLoader::myCompleteUnloadTime [protected] |
DtReal DtVrfMunitionLoader::myLoadAmmoTime [protected] |
Fed from controller based on the value from the descriptor.
DtReal DtVrfMunitionLoader::myUnloadAmmoTime [protected] |
Fed from controller based on the value from the descriptor.
DtRwInt DtVrfMunitionLoader::myRoundsPerMagazine [protected] |
How many rounds the magazine holds; loader loads a magazine at a time.
Set by gun (actuator) using parameter values in the descriptor.
DtRwInt DtVrfMunitionLoader::myRoundsLeftInMagazine [protected] |
How many rounds left to be fired before becoming unloaded.