|
VR-Engage
2.2
|
This class provides a readable/writable list of DtProjectile objects. It handles reading and writing projectile objects of various types to/from files or streams, and provides methods for adding and managing projectiles in the list. The list is used to track and manage multiple projectiles in the simulation.
#include <projectileList.h>
Public Member Functions | |
| DtProjectileList (const DtString &name, DtReaderWriterRegistry *parentRegistry=0) | |
| DtProjectileList (const DtProjectileList &orig, DtReaderWriterRegistry *parentRegistry=0) | |
| DtProjectileList & | operator= (const DtProjectileList &orig) |
| virtual | ~DtProjectileList () override |
| virtual DtProjectileList * | clone (DtReaderWriterRegistry *parentRegistry=0) |
| virtual void | emptyList () |
| virtual void | copyList (const DtProjectileList &orig) |
| virtual DtProjectile * | addProjectile (const DtProjectile &projectile) |
| virtual const char * | readerWriterType () const override |
| bool | operator== (const DtProjectileList &) const |
Protected Member Functions | |
| DtProjectileList () | |
| virtual void | addProjectile (DtProjectile *projectile) |
| virtual DtlObjPtr | getData (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings) override |
|
protected |
Default constructor (protected)
Default constructor is protected to prevent creation of unnamed instances. Use the public constructor with a name instead.
Referenced by clone(), copyList(), DtProjectileList(), operator=(), and operator==().
| makVre::DtProjectileList::DtProjectileList | ( | const DtString & | name, |
| DtReaderWriterRegistry * | parentRegistry = 0 ) |
Constructor with name.
| name | The name of this projectile list |
| parentRegistry | Parent registry for reader/writer functionality (optional) |
Creates a new projectile list with the specified name.
| makVre::DtProjectileList::DtProjectileList | ( | const DtProjectileList & | orig, |
| DtReaderWriterRegistry * | parentRegistry = 0 ) |
Copy constructor.
| orig | The source projectile list to copy from |
| parentRegistry | Parent registry for reader/writer functionality (optional) |
Creates a new projectile list as a copy of the provided original.
References DtProjectileList().
|
overridevirtual |
Virtual destructor.
Cleans up resources used by the projectile list, including all contained projectile objects.
| DtProjectileList & makVre::DtProjectileList::operator= | ( | const DtProjectileList & | orig | ) |
Assignment operator.
| orig | The source projectile list to copy from |
Assigns the contents of the provided list to this one. Removes and deletes all entries on the left hand side, then clones all entries on the right side list and adds them to the left side list.
References DtProjectileList().
|
virtual |
Creates a clone of this projectile list.
| parentRegistry | Parent registry for reader/writer functionality (optional) |
Creates a new projectile list as a deep copy of this one, including all contained projectile objects.
References DtProjectileList().
|
virtual |
Removes and destroys all projectiles from the list.
Clears the list by removing and destroying all contained projectile objects.
|
virtual |
Copies all projectiles from another list.
| orig | The source projectile list to copy from |
Copies all projectiles from the provided list to this one. Any existing projectiles in this list are preserved.
References DtProjectileList().
|
virtual |
Adds a projectile to the list by copying.
| projectile | The projectile to add |
Makes a clone of the provided projectile and adds it to the list. The returned pointer is owned by this list and should not be deleted by the caller.
|
overridevirtual |
Gets the reader/writer type identifier.
Returns a unique type identifier string for this list type. Will return DtProjectileListType.
| bool makVre::DtProjectileList::operator== | ( | const DtProjectileList & | ) | const |
Equality operator.
| other | The projectile list to compare with (unnamed parameter) |
Compares this projectile list with another to determine if they are equal. Lists are equal if they contain the same number of items and each item is equal to the corresponding item in the other list.
References DtProjectileList().
|
protectedvirtual |
Adds a pre-created projectile to the list.
| projectile | Pointer to the projectile to add |
Adds the provided projectile to the list. The projectile will be owned by this list and destroyed when the list is emptied or destroyed. This protected method is used internally when loading projectiles from a file or stream.
|
overrideprotectedvirtual |
Handles reading projectiles from an MTL stream.
| args | Input stream from an MTL file |
| searchPaths | Search paths for resolving references |
| variableBindings | Variable bindings for resolving references |
Overrides the base class getData method to handle reading projectiles from an MTL stream. Constructs a projectile object, retrieves it from the MTL stream, and then adds it to the list.