26 for(itLink = itLink.begin(&t_tree);
27 itLink != itLink.end();
30 pcLinkEntity->Init(*itLink);
32 m_vecLinks.push_back(pcLinkEntity);
35 std::string strReferenceLink;
37 auto itReferenceLink =
38 std::find_if(std::begin(m_vecLinks),
41 return (pc_link->
GetId() == strReferenceLink);
44 if(itReferenceLink == std::end(m_vecLinks)) {
48 if(itReferenceLink != std::begin(m_vecLinks)) {
50 *itReferenceLink = m_vecLinks.front();
51 m_vecLinks.front() = pcReferenceLink;
65 std::find_if(std::begin(m_vecLinks),
68 return (pc_link->
GetId() == str_id);
71 "CPrototypeLinkEquippedEntity::GetLink(), id=\"" <<
73 "\": link not found: str_id = " <<
83 "CPrototypeLinkEquippedEntity::GetLink(), id=\"" <<
85 "\": index out of bounds: un_index = " <<
87 ", m_vecLinks.size() = " <<
89 return *m_vecLinks[un_index];
#define ARGOS_ASSERT(condition, message)
When code is compiled in debug, this macro throws an ARGoS exception with the passed message if the s...
#define THROW_ARGOSEXCEPTION_NESTED(message, nested)
This macro throws an ARGoS exception with the passed message and nesting the passed exception.
#define THROW_ARGOSEXCEPTION(message)
This macro throws an ARGoS exception with the passed message.
unsigned int UInt32
32-bit unsigned integer.
The namespace containing all the ARGoS related code.
ticpp::Iterator< ticpp::Element > TConfigurationNodeIterator
The iterator for the ARGoS configuration XML node.
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
REGISTER_STANDARD_SPACE_OPERATIONS_ON_COMPOSABLE(CComposableEntity)
void GetNodeAttribute(TConfigurationNode &t_node, const std::string &str_attribute, T &t_buffer)
Returns the value of a node's attribute.
Basic class for an entity that contains other entities.
void AddComponent(CEntity &c_component)
Adds a component to this composable entity.
const std::string & GetId() const
Returns the id of this entity.
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
The exception that wraps all errors in ARGoS.
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
CPrototypeLinkEntity & GetLink(UInt32 un_index)
CPrototypeLinkEquippedEntity(CComposableEntity *pc_parent)