#include <activeobjectmgr.h>
Public Member Functions | |
~ActiveObjectMgr () override | |
void | clearIf (const std::function< bool(ServerActiveObject *, u16)> &cb) |
void | step (float dtime, const std::function< void(ServerActiveObject *)> &f) override |
bool | registerObject (std::unique_ptr< ServerActiveObject > obj) override |
void | removeObject (u16 id) override |
void | invalidateActiveObjectObserverCaches () |
void | getObjectsInsideRadius (const v3f &pos, float radius, std::vector< ServerActiveObject * > &result, std::function< bool(ServerActiveObject *obj)> include_obj_cb) |
void | getObjectsInArea (const aabb3f &box, std::vector< ServerActiveObject * > &result, std::function< bool(ServerActiveObject *obj)> include_obj_cb) |
void | getAddedActiveObjectsAroundPos (const v3f &player_pos, const std::string &player_name, f32 radius, f32 player_radius, const std::set< u16 > ¤t_objects, std::vector< u16 > &added_objects) |
Public Member Functions inherited from ActiveObjectMgr< ServerActiveObject > | |
ActiveObjectMgr ()=default | |
DISABLE_CLASS_COPY (ActiveObjectMgr) | |
void | clear () |
ServerActiveObject * | getActiveObject (u16 id) |
Additional Inherited Members | |
Protected Member Functions inherited from ActiveObjectMgr< ServerActiveObject > | |
u16 | getFreeId () const |
bool | isFreeId (u16 id) const |
Protected Attributes inherited from ActiveObjectMgr< ServerActiveObject > | |
ModifySafeMap< u16, std::unique_ptr< ServerActiveObject > > | m_active_objects |
|
overridevirtual |
Reimplemented from ActiveObjectMgr< ServerActiveObject >.
References ActiveObjectMgr< ServerActiveObject >::clear(), ModifySafeMap< K, V >::empty(), ActiveObjectMgr< ServerActiveObject >::m_active_objects, and warningstream.
void ActiveObjectMgr< T >::clearIf | ( | const std::function< bool(ServerActiveObject *, u16)> & | cb | ) |
References ModifySafeMap< K, V >::iter(), ActiveObjectMgr< ServerActiveObject >::m_active_objects, and ModifySafeMap< K, V >::remove().
Referenced by ServerEnvironment::clearObjects(), ServerEnvironment::deactivateFarObjects(), and ServerEnvironment::removeRemovedObjects().
void ActiveObjectMgr< T >::getAddedActiveObjectsAroundPos | ( | const v3f & | player_pos, |
const std::string & | player_name, | ||
f32 | radius, | ||
f32 | player_radius, | ||
const std::set< u16 > & | current_objects, | ||
std::vector< u16 > & | added_objects ) |
References ACTIVEOBJECT_TYPE_PLAYER, ServerActiveObject::getBasePosition(), ActiveObject::getType(), ServerActiveObject::isEffectivelyObservedBy(), ServerActiveObject::isGone(), ModifySafeMap< K, V >::iter(), and ActiveObjectMgr< ServerActiveObject >::m_active_objects.
Referenced by ServerEnvironment::getAddedActiveObjects(), and TestServerActiveObjectMgr::testGetAddedActiveObjectsAroundPos().
void ActiveObjectMgr< T >::getObjectsInArea | ( | const aabb3f & | box, |
std::vector< ServerActiveObject * > & | result, | ||
std::function< bool(ServerActiveObject *obj)> | include_obj_cb ) |
References ServerActiveObject::getBasePosition(), ModifySafeMap< K, V >::iter(), and ActiveObjectMgr< ServerActiveObject >::m_active_objects.
Referenced by benchGetObjectsInArea(), and ServerEnvironment::getObjectsInArea().
void ActiveObjectMgr< T >::getObjectsInsideRadius | ( | const v3f & | pos, |
float | radius, | ||
std::vector< ServerActiveObject * > & | result, | ||
std::function< bool(ServerActiveObject *obj)> | include_obj_cb ) |
References ServerActiveObject::getBasePosition(), ModifySafeMap< K, V >::iter(), and ActiveObjectMgr< ServerActiveObject >::m_active_objects.
Referenced by benchGetObjectsInsideRadius(), ServerEnvironment::getObjectsInsideRadius(), and TestServerActiveObjectMgr::testGetObjectsInsideRadius().
void ActiveObjectMgr< T >::invalidateActiveObjectObserverCaches | ( | ) |
References ServerActiveObject::invalidateEffectiveObservers(), ModifySafeMap< K, V >::iter(), and ActiveObjectMgr< ServerActiveObject >::m_active_objects.
Referenced by ServerEnvironment::invalidateActiveObjectObserverCaches().
|
overridevirtual |
Implements ActiveObjectMgr< ServerActiveObject >.
References errorstream, ActiveObjectMgr< ServerActiveObject >::getFreeId(), ActiveObjectMgr< ServerActiveObject >::isFreeId(), ActiveObjectMgr< ServerActiveObject >::m_active_objects, objectpos_over_limit(), p(), ModifySafeMap< K, V >::put(), ModifySafeMap< K, V >::size(), verbosestream, and warningstream.
Referenced by ServerEnvironment::addActiveObjectRaw(), TestServerActiveObjectMgr::testFreeID(), TestServerActiveObjectMgr::testGetAddedActiveObjectsAroundPos(), TestServerActiveObjectMgr::testGetObjectsInsideRadius(), TestServerActiveObjectMgr::testRegisterObject(), and TestServerActiveObjectMgr::testRemoveObject().
|
overridevirtual |
Implements ActiveObjectMgr< ServerActiveObject >.
References infostream, ActiveObjectMgr< ServerActiveObject >::m_active_objects, ModifySafeMap< K, V >::remove(), and verbosestream.
Referenced by ServerEnvironment::addActiveObjectRaw(), and TestServerActiveObjectMgr::testRemoveObject().
|
overridevirtual |
Implements ActiveObjectMgr< ServerActiveObject >.
References Profiler::avg(), g_profiler, ModifySafeMap< K, V >::iter(), and ActiveObjectMgr< ServerActiveObject >::m_active_objects.
Referenced by ServerEnvironment::step().