Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
ActiveObjectMgr< T > Class Template Referenceabstract

#include <activeobjectmgr.h>

+ Collaboration diagram for ActiveObjectMgr< T >:

Public Member Functions

 ActiveObjectMgr ()=default
 
 DISABLE_CLASS_COPY (ActiveObjectMgr)
 
virtual ~ActiveObjectMgr ()
 
virtual void step (float dtime, const std::function< void(T *)> &f)=0
 
virtual bool registerObject (std::unique_ptr< T > obj)=0
 
virtual void removeObject (u16 id)=0
 
void clear ()
 
T * getActiveObject (u16 id)
 

Protected Member Functions

u16 getFreeId () const
 
bool isFreeId (u16 id) const
 

Protected Attributes

ModifySafeMap< u16, std::unique_ptr< T > > m_active_objects
 

Friends

class ::TestClientActiveObjectMgr
 
class ::TestServerActiveObjectMgr
 

Constructor & Destructor Documentation

◆ ActiveObjectMgr()

template<typename T >
ActiveObjectMgr< T >::ActiveObjectMgr ( )
default

◆ ~ActiveObjectMgr()

template<typename T >
virtual ActiveObjectMgr< T >::~ActiveObjectMgr ( )
inlinevirtual

Reimplemented in client::ActiveObjectMgr, and server::ActiveObjectMgr.

References ModifySafeMap< K, V >::empty(), ActiveObjectMgr< T >::m_active_objects, and SANITY_CHECK.

+ Here is the call graph for this function:

Member Function Documentation

◆ clear()

◆ DISABLE_CLASS_COPY()

template<typename T >
ActiveObjectMgr< T >::DISABLE_CLASS_COPY ( ActiveObjectMgr< T >  )

◆ getActiveObject()

template<typename T >
T * ActiveObjectMgr< T >::getActiveObject ( u16  id)
inline

References ModifySafeMap< K, V >::get(), and ActiveObjectMgr< T >::m_active_objects.

Referenced by ClientEnvironment::getActiveObject(), ServerEnvironment::getActiveObject(), ServerEnvironment::setStaticForActiveObjectsInBlock(), TestClientActiveObjectMgr::testRegisterObject(), TestServerActiveObjectMgr::testRegisterObject(), TestClientActiveObjectMgr::testRemoveObject(), and TestServerActiveObjectMgr::testRemoveObject().

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

◆ getFreeId()

template<typename T >
u16 ActiveObjectMgr< T >::getFreeId ( ) const
inlineprotected

References ActiveObjectMgr< T >::isFreeId().

Referenced by TestClientActiveObjectMgr::testFreeID(), and TestServerActiveObjectMgr::testFreeID().

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

◆ isFreeId()

template<typename T >
bool ActiveObjectMgr< T >::isFreeId ( u16  id) const
inlineprotected

References ModifySafeMap< K, V >::get(), and ActiveObjectMgr< T >::m_active_objects.

Referenced by ActiveObjectMgr< T >::getFreeId().

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

◆ registerObject()

template<typename T >
virtual bool ActiveObjectMgr< T >::registerObject ( std::unique_ptr< T >  obj)
pure virtual

◆ removeObject()

template<typename T >
virtual void ActiveObjectMgr< T >::removeObject ( u16  id)
pure virtual

◆ step()

template<typename T >
virtual void ActiveObjectMgr< T >::step ( float  dtime,
const std::function< void(T *)> &  f 
)
pure virtual

Friends And Related Function Documentation

◆ ::TestClientActiveObjectMgr

template<typename T >
friend class ::TestClientActiveObjectMgr
friend

◆ ::TestServerActiveObjectMgr

template<typename T >
friend class ::TestServerActiveObjectMgr
friend

Member Data Documentation

◆ m_active_objects


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