diff options
Diffstat (limited to 'src/beingmanager.cpp')
-rw-r--r-- | src/beingmanager.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/beingmanager.cpp b/src/beingmanager.cpp index 11fc1c6d..b683b1bd 100644 --- a/src/beingmanager.cpp +++ b/src/beingmanager.cpp @@ -146,6 +146,21 @@ Being* BeingManager::findBeingByPixel(Uint16 x, Uint16 y) return NULL; } +Being* BeingManager::findBeingByName(std::string name, Being::Type type) +{ + for (BeingIterator i = mBeings.begin(); i != mBeings.end(); i++) + { + Being *being = (*i); + if (being->getName() == name + && (type == Being::UNKNOWN + || type == being->getType())) + return being; + } + return NULL; +} + + + Beings& BeingManager::getAll() { return mBeings; |