VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Types | Protected Attributes
DtSimResourceList Class Reference

class DtSimResourceList:

Public Member Functions

 DtSimResourceList (int bin=0)
 
 DtSimResourceList (const DtSimResourceList &)
 
virtual ~DtSimResourceList ()
 
virtual DtSimResourceaddResource (const DtEntityType &, double amount)
 
virtual DtSimResourceaddResource (DtSimResource)
 
virtual bool removeResource (const DtEntityType &)
 
virtual DtSimResourcelookupResource (const DtEntityType &resourceName) const
 
virtual std::vector
< DtSimResource * > 
resources (const std::vector< DtEntityType > &=std::vector< DtEntityType >()) const
 
virtual void clear ()
 
virtual void merge (const DtSimResourceList &)
 
virtual void restoreResources ()
 
virtual void restoreFrom (const DtSimResourceList &)
 
virtual std::list< DtEntityType > getResourceTypes () const
 
virtual std::list< DtEntityType > getResourceTypes (const std::vector< DtEntityType > &types, double greaterThanAmount=0) const
 
DtSimResourceListoperator= (const DtSimResourceList &)
 
bool operator== (const DtSimResourceList &) const
 
bool operator!= (const DtSimResourceList &rhs) const
 
int bin () const
 

Protected Types

typedef std::map< DtEntityType,
std::unique_ptr< DtSimResource > > 
ResourceByEntityTypeMap
 

Protected Attributes

ResourceByEntityTypeMap myResourceByEntityTypeMap
 
int myBin = 0
 

Member Typedef Documentation

typedef std::map<DtEntityType, std::unique_ptr<DtSimResource> > DtSimResourceList::ResourceByEntityTypeMap
protected

Constructor & Destructor Documentation

DtSimResourceList::DtSimResourceList ( int  bin = 0)

default constructor

DtSimResourceList::DtSimResourceList ( const DtSimResourceList )
virtual DtSimResourceList::~DtSimResourceList ( )
virtual

destructor

Member Function Documentation

virtual DtSimResource* DtSimResourceList::addResource ( const DtEntityType &  ,
double  amount 
)
virtual

Adds the specified resource. If the resource already exists, add the amount to the amount already there.

virtual DtSimResource* DtSimResourceList::addResource ( DtSimResource  )
virtual
virtual bool DtSimResourceList::removeResource ( const DtEntityType &  )
virtual

Removes the specified resource from this list.

virtual DtSimResource* DtSimResourceList::lookupResource ( const DtEntityType &  resourceName) const
virtual
virtual std::vector<DtSimResource*> DtSimResourceList::resources ( const std::vector< DtEntityType > &  = std::vector< DtEntityType >()) const
virtual
virtual void DtSimResourceList::clear ( )
virtual

Clears out all resources.

virtual void DtSimResourceList::merge ( const DtSimResourceList )
virtual

Adds in new resources that don't exist in this list and increases the value of existing resources. Will take the max of the current resource full amount and the supplied full amount. If the total would be > than the new full amount, caps at new full amount.

virtual void DtSimResourceList::restoreResources ( )
virtual

Calls to each resource to restore itsef.

virtual void DtSimResourceList::restoreFrom ( const DtSimResourceList )
virtual
virtual std::list<DtEntityType> DtSimResourceList::getResourceTypes ( ) const
virtual
virtual std::list<DtEntityType> DtSimResourceList::getResourceTypes ( const std::vector< DtEntityType > &  types,
double  greaterThanAmount = 0 
) const
virtual
DtSimResourceList& DtSimResourceList::operator= ( const DtSimResourceList )

The assignment operator will make a unique copy of the resources, not share the pointer of the original.

bool DtSimResourceList::operator== ( const DtSimResourceList ) const
bool DtSimResourceList::operator!= ( const DtSimResourceList rhs) const
inline
int DtSimResourceList::bin ( ) const
inline

The bin should be a unique number amongst other resource lists to identify this list (and the resources within) from a similar resource in another list managed by the DtSimObjectManager.

Member Data Documentation

ResourceByEntityTypeMap DtSimResourceList::myResourceByEntityTypeMap
protected
int DtSimResourceList::myBin = 0
protected

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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)