VR-Forces 4.0.4 Class Documentation
Public Member Functions | Protected Member Functions
DtFormation Class Reference

Instances of DtFormation are a list of DtFormationEntry objects which make up an aggregate formation. More...

Inheritance diagram for DtFormation:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtFormation ()
 default constructor
 DtFormation (const DtString &name, DtReaderWriterRegistry *const parentRegistry=0)
 constructor
 DtFormation (const DtFormation &orig)
 copy constructor
DtFormation & operator= (const DtFormation &orig)
 assignment operator
virtual ~DtFormation ()
 destructor
virtual void addPosition (int promotionId, int leaderPromotionId, const DtVector &positionOffset)
 Add an entry to the formation.
virtual void removeAndDeleteAll ()
 Removes and deletes memory associated with all entries in the formation.
virtual const DtFormationEntry * getFormationEntryForPromotionId (int) const
virtual DtFormationEntry * getFormationEntryForPromotionId (int)
virtual std::list< DtVector > formationPositions (int numEntitiesInFormation) const
bool operator== (const DtFormation &) const
bool operator!= (const DtFormation &) const
virtual void addEntry (DtFormationEntry *entry)
 Adds new entry to ourself.
virtual DtFormationEntry * createAndAddFormationEntry ()
 Creates and adds a new DtFormationEntry to the table.

Protected Member Functions

virtual DtVector newFormationEntryOffset () const
 Returns a new formation entry offset. If the first node, returns 0, 0, 0, else returns -10, 0, 0.
virtual void removeEntry (DtFormationEntry *entry)
 Removes and deletes the entry.
virtual void copyList (const DtFormation &orig)
virtual void emptyList ()
 Used by the destructor.
virtual DtlObjPtr getData (DtlObjPtr args, const DtFilename &searchPath, const DtVariableBindingsList &variableBindings)
 Constructs a DtFormationEntry item, and then retrieves it from the stream.

Detailed Description

Instances of DtFormation are a list of DtFormationEntry objects which make up an aggregate formation.


Constructor & Destructor Documentation

default constructor

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

constructor

copy constructor

virtual DtFormation::~DtFormation ( ) [virtual]

destructor


Member Function Documentation

DtFormation& DtFormation::operator= ( const DtFormation &  orig)

assignment operator

virtual void DtFormation::addPosition ( int  promotionId,
int  leaderPromotionId,
const DtVector &  positionOffset 
) [virtual]

Add an entry to the formation.

promotionId: Indicates relative 'importance' of position in the formation, starting with 0, e.g. 0 is the leader, 1 follows 0, 2 follows 1, and so on. All members in a formation have a unique promotion Id, starting with 0. There should be no gaps in promotionIds in a formation. For example, you should not have a formation consisting of 0, 1, 4, 5, 6 (the leaderPromotionId (in this case 2 and 3 are missing). leaderPromotionId: Promotion id of the formation member this entry is to follow. For the overall leader (the promotionId that doesn't follow anyone else, this value should -1. positionOffset: Offset in body coordinates of the leader, at which an entity in this formation position should try to maintain.

virtual void DtFormation::removeAndDeleteAll ( ) [virtual]

Removes and deletes memory associated with all entries in the formation.

virtual const DtFormationEntry* DtFormation::getFormationEntryForPromotionId ( int  ) const [virtual]
Returns:
Formation where the promotionId matches the supplied id. If no entry exists, returns NULL
virtual std::list<DtVector> DtFormation::formationPositions ( int  numEntitiesInFormation) const [virtual]
Returns:
A list of the offset positions for the first numEntitiesInFormation number of entities in this formation. Positions are specified in body coordinate system (X forward, Y out right size, Z down) The first position in the list will always be (0,0,0), and all others will be relative to that position.
bool DtFormation::operator== ( const DtFormation &  ) const
bool DtFormation::operator!= ( const DtFormation &  ) const
virtual void DtFormation::addEntry ( DtFormationEntry *  entry) [virtual]

Adds new entry to ourself.

Creates and adds a new DtFormationEntry to the table.

If it is the first node, will be at 0, 0, 0. If a node other than the first node, will call newFormationEntryOffset() to return the new offset. The node will follow the last node in the formation

virtual DtVector DtFormation::newFormationEntryOffset ( ) const [protected, virtual]

Returns a new formation entry offset. If the first node, returns 0, 0, 0, else returns -10, 0, 0.

virtual void DtFormation::removeEntry ( DtFormationEntry *  entry) [protected, virtual]

Removes and deletes the entry.

virtual void DtFormation::copyList ( const DtFormation &  orig) [protected, virtual]
virtual void DtFormation::emptyList ( ) [protected, virtual]

Used by the destructor.

It removes and DELETES all formation entries on the list.

virtual DtlObjPtr DtFormation::getData ( DtlObjPtr  args,
const DtFilename &  searchPath,
const DtVariableBindingsList &  variableBindings 
) [protected, virtual]

Constructs a DtFormationEntry item, and then retrieves it from the stream.

Implements DtRwList.


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)