33 const std::string& str_id) :
47 for(itMagnet = itMagnet.begin(&t_tree);
48 itMagnet != itMagnet.end();
52 pcMagnet->Init(*itMagnet);
56 std::string strAnchorId;
69 cBody.GetAnchor(strAnchorId),
86 s_instance.Magnet.Enable();
96 s_instance.Magnet.Disable();
105 "CMagnetEquippedEntity::GetMagnet(), id=\"" <<
107 "\": index out of bounds: un_index = " <<
109 ", m_vecInstances.size() = " <<
122 auto* pcMagnet =
new CMagnetEntity(
this, str_id, c_passive_field, c_active_field);
123 m_vecInstances.emplace_back(*pcMagnet, s_anchor, c_position_offset);
#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.
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.
CEntity & GetComponent(const std::string &str_component)
Returns the component with the passed string label.
void AddComponent(CEntity &c_component)
Adds a component to this composable entity.
This entity is a link to a body in the physics engine.
void Disable()
Disables the entity.
const std::string & GetId() const
Returns the id of this entity.
void Enable()
Enables the entity.
CComposableEntity & GetParent()
Returns this entity's parent.
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
An anchor related to the body of an entity.
The exception that wraps all errors in ARGoS.
A container of CMagnetEntity.
CMagnetEntity & GetMagnet(UInt32 un_index)
Returns an magnet by numeric index.
CMagnetEntity & AddMagnet(const std::string &str_id, SAnchor &s_anchor, const CVector3 &c_position_offset, const CVector3 &c_passive_field, const CVector3 &c_active_field=CVector3())
SInstance::TVector m_vecInstances
A list of the magnets managed by this entity.
virtual void UpdateComponents()
Calls the Update() method on all the components.
CMagnetEquippedEntity(CComposableEntity *pc_parent)
Class constructor.
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
SInstance(CMagnetEntity &c_magnet, SAnchor &s_anchor, const CVector3 &c_position_offset)