Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
server::ActiveObjectMgr Class Referencefinal

#include <activeobjectmgr.h>

+ Inheritance diagram for server::ActiveObjectMgr:
+ Collaboration diagram for server::ActiveObjectMgr:

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 > &current_objects, std::vector< u16 > &added_objects)
 
- Public Member Functions inherited from ActiveObjectMgr< ServerActiveObject >
 ActiveObjectMgr ()=default
 
 DISABLE_CLASS_COPY (ActiveObjectMgr)
 
void clear ()
 
ServerActiveObjectgetActiveObject (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
 

Constructor & Destructor Documentation

◆ ~ActiveObjectMgr()

ActiveObjectMgr< T >::~ActiveObjectMgr ( )
overridevirtual

Reimplemented from ActiveObjectMgr< ServerActiveObject >.

References ActiveObjectMgr< ServerActiveObject >::clear(), ModifySafeMap< K, V >::empty(), ActiveObjectMgr< ServerActiveObject >::m_active_objects, and warningstream.

+ Here is the call graph for this function:

Member Function Documentation

◆ clearIf()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAddedActiveObjectsAroundPos()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getObjectsInArea()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getObjectsInsideRadius()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ invalidateActiveObjectObserverCaches()

void ActiveObjectMgr< T >::invalidateActiveObjectObserverCaches ( )

References ServerActiveObject::invalidateEffectiveObservers(), ModifySafeMap< K, V >::iter(), and ActiveObjectMgr< ServerActiveObject >::m_active_objects.

Referenced by ServerEnvironment::invalidateActiveObjectObserverCaches().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerObject()

bool ActiveObjectMgr< T >::registerObject ( std::unique_ptr< ServerActiveObject > obj)
overridevirtual

◆ removeObject()

void ActiveObjectMgr< T >::removeObject ( u16 id)
overridevirtual

Implements ActiveObjectMgr< ServerActiveObject >.

References infostream, ActiveObjectMgr< ServerActiveObject >::m_active_objects, ModifySafeMap< K, V >::remove(), and verbosestream.

Referenced by ServerEnvironment::addActiveObjectRaw(), and TestServerActiveObjectMgr::testRemoveObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ step()

void ActiveObjectMgr< T >::step ( float dtime,
const std::function< void(ServerActiveObject *)> & f )
overridevirtual

Implements ActiveObjectMgr< ServerActiveObject >.

References Profiler::avg(), g_profiler, ModifySafeMap< K, V >::iter(), and ActiveObjectMgr< ServerActiveObject >::m_active_objects.

Referenced by ServerEnvironment::step().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: