xoreos
0.0.5
|
#include <objectcontainer.h>
Public Member Functions | |
ObjectContainer () | |
~ObjectContainer () | |
void | clearObjects () |
void | addObject (Object &object) |
Add an object to this container. More... | |
void | removeObject (Object &object) |
Remove an object from this container. More... | |
Object * | getObjectByID (uint32 id) const |
Find a specific object by ID. More... | |
Object * | getFirstObject () const |
Return the first object. More... | |
Object * | getFirstObjectByTag (const Common::UString &tag) const |
Return the first object with this tag. More... | |
ObjectSearch * | findObjects () const |
Return a search context to iterate over all objects. More... | |
ObjectSearch * | findObjectsByTag (const Common::UString &tag) const |
Return a search context to iterate over all objects with this tag. More... | |
Protected Member Functions | |
void | lock () |
void | unlock () |
Private Types | |
typedef std::map< uint32, Object * > | ObjectIDMap |
typedef SearchList::type | ObjectList |
typedef SearchTagMap::type | ObjectTagMap |
Private Attributes | |
Common::Mutex | _mutex |
ObjectList | _objects |
ObjectIDMap | _objectsByID |
ObjectTagMap | _objectsByTag |
Definition at line 100 of file objectcontainer.h.
|
private |
Definition at line 132 of file objectcontainer.h.
|
private |
Definition at line 133 of file objectcontainer.h.
|
private |
Definition at line 134 of file objectcontainer.h.
Aurora::NWScript::ObjectContainer::ObjectContainer | ( | ) |
Definition at line 37 of file objectcontainer.cpp.
Aurora::NWScript::ObjectContainer::~ObjectContainer | ( | ) |
Definition at line 40 of file objectcontainer.cpp.
void Aurora::NWScript::ObjectContainer::addObject | ( | Object & | object | ) |
Add an object to this container.
Definition at line 51 of file objectcontainer.cpp.
References _mutex, _objects, _objectsByID, and _objectsByTag.
Referenced by Engines::Sonic::ObjectContainer::addObject(), Engines::Jade::ObjectContainer::addObject(), Engines::KotOR2::ObjectContainer::addObject(), Engines::NWN2::ObjectContainer::addObject(), Engines::Witcher::ObjectContainer::addObject(), Engines::KotOR::ObjectContainer::addObject(), Engines::NWN::ObjectContainer::addObject(), Engines::DragonAge2::ObjectContainer::addObject(), and Engines::DragonAge::ObjectContainer::addObject().
void Aurora::NWScript::ObjectContainer::clearObjects | ( | ) |
Definition at line 43 of file objectcontainer.cpp.
References _mutex, _objects, _objectsByID, and _objectsByTag.
Referenced by Engines::Sonic::ObjectContainer::clearObjects(), Engines::Jade::ObjectContainer::clearObjects(), Engines::KotOR2::ObjectContainer::clearObjects(), Engines::NWN2::ObjectContainer::clearObjects(), Engines::Witcher::ObjectContainer::clearObjects(), Engines::KotOR::ObjectContainer::clearObjects(), Engines::NWN::ObjectContainer::clearObjects(), Engines::DragonAge2::ObjectContainer::clearObjects(), and Engines::DragonAge::ObjectContainer::clearObjects().
ObjectSearch * Aurora::NWScript::ObjectContainer::findObjects | ( | ) | const |
Return a search context to iterate over all objects.
Definition at line 98 of file objectcontainer.cpp.
References _objects.
Referenced by Engines::Witcher::Functions::getNearestCreature(), Engines::NWN::Functions::getNearestCreature(), Engines::NWN2::Functions::getNearestCreature(), Engines::Witcher::Functions::getNearestObject(), Engines::NWN::Functions::getNearestObject(), Engines::Jade::Functions::getNearestObject(), Engines::DragonAge::Functions::getNearestObject(), Engines::NWN2::Functions::getNearestObject(), and Engines::DragonAge2::Functions::getNearestObject().
ObjectSearch * Aurora::NWScript::ObjectContainer::findObjectsByTag | ( | const Common::UString & | tag | ) | const |
Return a search context to iterate over all objects with this tag.
Definition at line 102 of file objectcontainer.cpp.
References _objectsByTag.
Referenced by Engines::Witcher::Functions::getNearestObjectByTag(), Engines::NWN::Functions::getNearestObjectByTag(), Engines::NWN2::Functions::getNearestObjectByTag(), Engines::DragonAge::Functions::getNearestObjectByTag(), Engines::DragonAge2::Functions::getNearestObjectByTag(), Engines::KotOR2::Functions::getObjectByTag(), Engines::KotOR::Functions::getObjectByTag(), Engines::Witcher::Functions::getObjectByTag(), Engines::NWN::Functions::getObjectByTag(), Engines::Jade::Functions::getObjectByTag(), Engines::DragonAge::Functions::getObjectByTag(), Engines::NWN2::Functions::getObjectByTag(), Engines::DragonAge2::Functions::getObjectByTag(), Engines::Witcher::Module::getObjectLocation(), Engines::KotOR2::Module::getObjectLocation(), Engines::KotOR::Module::getObjectLocation(), Engines::Witcher::Functions::getWaypointByTag(), Engines::NWN::Functions::getWaypointByTag(), Engines::Jade::Functions::getWaypointByTag(), Engines::NWN2::Functions::getWaypointByTag(), Engines::DragonAge::Functions::UT_getNearestObjectByTag(), and Engines::DragonAge2::Functions::UT_getNearestObjectByTag().
Object * Aurora::NWScript::ObjectContainer::getFirstObject | ( | ) | const |
Return the first object.
Definition at line 86 of file objectcontainer.cpp.
References _objects, and Aurora::NWScript::SearchRange< T >::get().
Referenced by Engines::DragonAge::Area::getEntryLocation(), and Engines::DragonAge2::Area::getEntryLocation().
Object * Aurora::NWScript::ObjectContainer::getFirstObjectByTag | ( | const Common::UString & | tag | ) | const |
Return the first object with this tag.
Definition at line 92 of file objectcontainer.cpp.
References _objectsByTag, and Aurora::NWScript::SearchRange< T >::get().
Referenced by Engines::NWN2::Door::evaluateLink(), Engines::NWN::Door::evaluateLink(), Engines::DragonAge2::Area::getEntryLocation(), Engines::DragonAge::Area::getEntryLocation(), and Engines::NWN::Dialog::getSpeaker().
Find a specific object by ID.
Definition at line 78 of file objectcontainer.cpp.
References _objectsByID.
|
protected |
Definition at line 106 of file objectcontainer.cpp.
References _mutex, and Common::Mutex::lock().
Referenced by Engines::Sonic::ObjectContainer::addObject(), Engines::Jade::ObjectContainer::addObject(), Engines::KotOR2::ObjectContainer::addObject(), Engines::NWN::ObjectContainer::addObject(), Engines::KotOR::ObjectContainer::addObject(), Engines::NWN2::ObjectContainer::addObject(), Engines::Witcher::ObjectContainer::addObject(), Engines::DragonAge2::ObjectContainer::addObject(), Engines::DragonAge::ObjectContainer::addObject(), Engines::Sonic::ObjectContainer::clearObjects(), Engines::Jade::ObjectContainer::clearObjects(), Engines::KotOR2::ObjectContainer::clearObjects(), Engines::NWN::ObjectContainer::clearObjects(), Engines::NWN2::ObjectContainer::clearObjects(), Engines::Witcher::ObjectContainer::clearObjects(), Engines::KotOR::ObjectContainer::clearObjects(), Engines::DragonAge2::ObjectContainer::clearObjects(), Engines::DragonAge::ObjectContainer::clearObjects(), Engines::Sonic::ObjectContainer::removeObject(), Engines::Jade::ObjectContainer::removeObject(), Engines::KotOR2::ObjectContainer::removeObject(), Engines::NWN2::ObjectContainer::removeObject(), Engines::Witcher::ObjectContainer::removeObject(), Engines::NWN::ObjectContainer::removeObject(), Engines::KotOR::ObjectContainer::removeObject(), Engines::DragonAge2::ObjectContainer::removeObject(), and Engines::DragonAge::ObjectContainer::removeObject().
void Aurora::NWScript::ObjectContainer::removeObject | ( | Object & | object | ) |
Remove an object from this container.
Definition at line 61 of file objectcontainer.cpp.
References _mutex, _objects, _objectsByID, and _objectsByTag.
Referenced by Engines::Sonic::ObjectContainer::removeObject(), Engines::Jade::ObjectContainer::removeObject(), Engines::KotOR2::ObjectContainer::removeObject(), Engines::NWN2::ObjectContainer::removeObject(), Engines::Witcher::ObjectContainer::removeObject(), Engines::KotOR::ObjectContainer::removeObject(), Engines::NWN::ObjectContainer::removeObject(), Engines::DragonAge2::ObjectContainer::removeObject(), and Engines::DragonAge::ObjectContainer::removeObject().
|
protected |
Definition at line 110 of file objectcontainer.cpp.
References _mutex, and Common::Mutex::unlock().
Referenced by Engines::Sonic::ObjectContainer::addObject(), Engines::Jade::ObjectContainer::addObject(), Engines::KotOR2::ObjectContainer::addObject(), Engines::NWN::ObjectContainer::addObject(), Engines::KotOR::ObjectContainer::addObject(), Engines::NWN2::ObjectContainer::addObject(), Engines::Witcher::ObjectContainer::addObject(), Engines::DragonAge2::ObjectContainer::addObject(), Engines::DragonAge::ObjectContainer::addObject(), Engines::Sonic::ObjectContainer::clearObjects(), Engines::Jade::ObjectContainer::clearObjects(), Engines::KotOR2::ObjectContainer::clearObjects(), Engines::NWN::ObjectContainer::clearObjects(), Engines::NWN2::ObjectContainer::clearObjects(), Engines::Witcher::ObjectContainer::clearObjects(), Engines::KotOR::ObjectContainer::clearObjects(), Engines::DragonAge2::ObjectContainer::clearObjects(), Engines::DragonAge::ObjectContainer::clearObjects(), Engines::Sonic::ObjectContainer::removeObject(), Engines::Jade::ObjectContainer::removeObject(), Engines::KotOR2::ObjectContainer::removeObject(), Engines::NWN2::ObjectContainer::removeObject(), Engines::Witcher::ObjectContainer::removeObject(), Engines::NWN::ObjectContainer::removeObject(), Engines::KotOR::ObjectContainer::removeObject(), Engines::DragonAge2::ObjectContainer::removeObject(), and Engines::DragonAge::ObjectContainer::removeObject().
|
private |
Definition at line 136 of file objectcontainer.h.
Referenced by addObject(), clearObjects(), lock(), removeObject(), and unlock().
|
private |
Definition at line 138 of file objectcontainer.h.
Referenced by addObject(), clearObjects(), findObjects(), getFirstObject(), and removeObject().
|
private |
Definition at line 139 of file objectcontainer.h.
Referenced by addObject(), clearObjects(), getObjectByID(), and removeObject().
|
private |
Definition at line 140 of file objectcontainer.h.
Referenced by addObject(), clearObjects(), findObjectsByTag(), getFirstObjectByTag(), and removeObject().