VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtProjectileList Class Reference

Detailed Description

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>

Inheritance diagram for makVre::DtProjectileList:
[legend]

Public Member Functions

 DtProjectileList (const DtString &name, DtReaderWriterRegistry *parentRegistry=0)
 
 DtProjectileList (const DtProjectileList &orig, DtReaderWriterRegistry *parentRegistry=0)
 
DtProjectileListoperator= (const DtProjectileList &orig)
 
virtual ~DtProjectileList () override
 
virtual DtProjectileListclone (DtReaderWriterRegistry *parentRegistry=0)
 
virtual void emptyList ()
 
virtual void copyList (const DtProjectileList &orig)
 
virtual DtProjectileaddProjectile (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
 

Constructor & Destructor Documentation

◆ DtProjectileList() [1/3]

makVre::DtProjectileList::DtProjectileList ( )
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==().

◆ DtProjectileList() [2/3]

makVre::DtProjectileList::DtProjectileList ( const DtString & name,
DtReaderWriterRegistry * parentRegistry = 0 )

Constructor with name.

Parameters
nameThe name of this projectile list
parentRegistryParent registry for reader/writer functionality (optional)

Creates a new projectile list with the specified name.

◆ DtProjectileList() [3/3]

makVre::DtProjectileList::DtProjectileList ( const DtProjectileList & orig,
DtReaderWriterRegistry * parentRegistry = 0 )

Copy constructor.

Parameters
origThe source projectile list to copy from
parentRegistryParent registry for reader/writer functionality (optional)

Creates a new projectile list as a copy of the provided original.

References DtProjectileList().

◆ ~DtProjectileList()

virtual makVre::DtProjectileList::~DtProjectileList ( )
overridevirtual

Virtual destructor.

Cleans up resources used by the projectile list, including all contained projectile objects.

Member Function Documentation

◆ operator=()

DtProjectileList & makVre::DtProjectileList::operator= ( const DtProjectileList & orig)

Assignment operator.

Parameters
origThe source projectile list to copy from
Returns
Reference to this projectile list after assignment

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().

◆ clone()

virtual DtProjectileList * makVre::DtProjectileList::clone ( DtReaderWriterRegistry * parentRegistry = 0)
virtual

Creates a clone of this projectile list.

Parameters
parentRegistryParent registry for reader/writer functionality (optional)
Returns
Pointer to a new projectile list that is a clone of this one

Creates a new projectile list as a deep copy of this one, including all contained projectile objects.

References DtProjectileList().

◆ emptyList()

virtual void makVre::DtProjectileList::emptyList ( )
virtual

Removes and destroys all projectiles from the list.

Clears the list by removing and destroying all contained projectile objects.

◆ copyList()

virtual void makVre::DtProjectileList::copyList ( const DtProjectileList & orig)
virtual

Copies all projectiles from another list.

Parameters
origThe 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().

◆ addProjectile() [1/2]

virtual DtProjectile * makVre::DtProjectileList::addProjectile ( const DtProjectile & projectile)
virtual

Adds a projectile to the list by copying.

Parameters
projectileThe projectile to add
Returns
Pointer to the newly added projectile

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.

◆ readerWriterType()

virtual const char * makVre::DtProjectileList::readerWriterType ( ) const
overridevirtual

Gets the reader/writer type identifier.

Returns
String identifying this list type

Returns a unique type identifier string for this list type. Will return DtProjectileListType.

◆ operator==()

bool makVre::DtProjectileList::operator== ( const DtProjectileList & ) const

Equality operator.

Parameters
otherThe projectile list to compare with (unnamed parameter)
Returns
True if the projectile lists are equal, false otherwise

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().

◆ addProjectile() [2/2]

virtual void makVre::DtProjectileList::addProjectile ( DtProjectile * projectile)
protectedvirtual

Adds a pre-created projectile to the list.

Parameters
projectilePointer 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.

◆ getData()

virtual DtlObjPtr makVre::DtProjectileList::getData ( DtlObjPtr args,
const DtReaderWriter::SearchPaths & searchPaths,
const DtVariableBindingsList & variableBindings )
overrideprotectedvirtual

Handles reading projectiles from an MTL stream.

Parameters
argsInput stream from an MTL file
searchPathsSearch paths for resolving references
variableBindingsVariable bindings for resolving references
Returns
Processed MTL stream after reading

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.


The documentation for this class was generated from the following file: