Skip to content

Commit

Permalink
PINK: Added findAction method
Browse files Browse the repository at this point in the history
  • Loading branch information
whitertandrek authored and sev- committed Jun 28, 2018
1 parent acbe2e8 commit d303144
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions engines/pink/actors/actor.cpp
Expand Up @@ -23,6 +23,7 @@
#include "actor.h"
#include "../page.h"
#include "lead_actor.h"
#include "../actions/action.h"

namespace Pink {

Expand All @@ -39,4 +40,11 @@ Sequencer *Actor::getSequencer() {
return _page->getSequencer();
}

Action *Actor::findAction(Common::String &name) {
return *Common::find_if(_actions.begin(), _actions.end(), [&name]
(Action* action) {
return name == action->getName();
});;
}

} // End of namespace Pink
3 changes: 3 additions & 0 deletions engines/pink/actors/actor.h
Expand Up @@ -36,6 +36,9 @@ class Actor : public NamedObject {
public:
Actor() {};
virtual void deserialize(Archive &archive);

Action *findAction(Common::String &name);

Sequencer *getSequencer();

protected:
Expand Down

0 comments on commit d303144

Please sign in to comment.