(C++)  1.0.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
grail::planning::ParametrizedObject Class Reference
Inheritance diagram for grail::planning::ParametrizedObject:
Collaboration diagram for grail::planning::ParametrizedObject:

Public Member Functions

void MergeParameters (const ParametrizedObject &other)
 
std::size_t GetParametersSize () const
 
bool Contains (const std::string &paramName) const
 
template<typename ParameterType >
void SetParameter (const std::string &paramName, const ParameterType &paramValue)
 
template<typename ParameterType >
ParameterType GetParameterValue (const std::string &paramName) const
 
bool CollectionContains (const std::string &collectionName, unsigned int objectIndex) const
 
void AddCollection (const std::string &collectionName)
 Creates a new id collection under the given name.
 
std::set< unsigned int > * GetCollection (const std::string &name)
 
const std::set< unsigned int > * GetCollection (const std::string &name) const
 
bool HasEqualParams (const ParametrizedObject &other) const
 
void SerializeForGUI (std::map< std::string, std::string > &nameValues) const
 
void SetSerializeForGUIFunction (std::function< void(const ParametrizedObject &object, std::map< std::string, std::string > &nameValues)> function)
 
ParametrizedObjectoperator= (const ParametrizedObject &other)
 
ParametrizedObjectoperator= (ParametrizedObject &&other)=delete
 

Protected Member Functions

 ParametrizedObject (MemoryPool &memory)
 
 ParametrizedObject (const ParametrizedObject &other)
 
 ParametrizedObject (ParametrizedObject &&other)=default
 

Protected Attributes

std::map< std::string, ObjectParameter * > parameters {}
 
std::map< std::string, std::set< unsigned int > > indexCollections {}
 
MemoryPoolmemory
 

Member Function Documentation

◆ CollectionContains()

bool grail::planning::ParametrizedObject::CollectionContains ( const std::string &  collectionName,
unsigned int  objectIndex 
) const
Returns
true if the object contains objectIndex in a collection identified collectionName

◆ Contains()

bool grail::planning::ParametrizedObject::Contains ( const std::string &  paramName) const
Returns
true if the object contains a parameter with the given name, false otherwise

◆ GetParametersSize()

std::size_t grail::planning::ParametrizedObject::GetParametersSize ( ) const
Returns
The number of parameters assigned to this object

◆ GetParameterValue()

template<typename ParameterType >
ParameterType grail::planning::ParametrizedObject::GetParameterValue ( const std::string &  paramName) const
inline
Returns
The parameter's value if a parameter with the given name exists, the default value otherwise

◆ SetParameter()

template<typename ParameterType >
void grail::planning::ParametrizedObject::SetParameter ( const std::string &  paramName,
const ParameterType &  paramValue 
)
inline

Updates the value of a parameter identified by the given name. If there's no such parameter, it will be added.


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