Mercurial > fife-parpg
diff engine/core/model/metamodel/object.cpp @ 306:6177cdf72489
- added new method to object class: getActionIds()
- cleanup to *.i file (replaced redundant code by including header file)
FEATURES:
- objects can now provide a list of action ids of all actions they were set up with
author | chewie@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sat, 08 Aug 2009 14:24:35 +0000 |
parents | 8eec4c078223 |
children |
line wrap: on
line diff
--- a/engine/core/model/metamodel/object.cpp Fri Aug 07 21:11:28 2009 +0000 +++ b/engine/core/model/metamodel/object.cpp Sat Aug 08 14:24:35 2009 +0000 @@ -94,6 +94,18 @@ } return i->second; } + + std::list<std::string> Object::getActionIds() const { + std::list<std::string> action_ids; + action_ids.clear(); + if (m_actions) { + std::map<std::string, Action*>::const_iterator actions_it = m_actions->begin(); + for(; actions_it != m_actions->end(); ++actions_it) { + action_ids.push_back(actions_it->first); + } + } + return action_ids; + } void Object::setPather(AbstractPather* pather) { m_pather = pather; @@ -126,4 +138,5 @@ bool Object::operator!=(const Object& obj) const { return m_id != obj.getId() || m_namespace != obj.getNamespace(); } + }