Luanti 5.16.0-dev
Loading...
Searching...
No Matches
TestServerActiveObjectMgr Class Reference
Collaboration diagram for TestServerActiveObjectMgr:

Public Member Functions

u16 getFreeId () const
bool registerObject (std::unique_ptr< ServerActiveObject > obj)
void removeObject (u16 id)
void updateObjectPos (u16 id, const v3f &pos)
void clear ()
ServerActiveObjectgetActiveObject (u16 id)
template<class T>
void getObjectsInsideRadius (T &&arg)
template<class T>
void getAddedActiveObjectsAroundPos (T &&arg)
bool empty ()
template<class T>
u16 randomId (T &random)
void getObjectsInsideRadiusNaive (const v3f &pos, float radius, std::vector< ServerActiveObject * > &result)
void getObjectsInAreaNaive (const aabb3f &box, std::vector< ServerActiveObject * > &result)
void compareObjects (std::vector< ServerActiveObject * > &actual, std::vector< ServerActiveObject * > &expected)
void compareObjectsInsideRadius (const v3f &pos, float radius)
void compareObjectsInArea (const aabb3f &box)

Static Public Member Functions

static void sortById (std::vector< ServerActiveObject * > &saos)

Static Public Attributes

static constexpr auto compare_by_id

Private Attributes

server::ActiveObjectMgr saomgr
std::vector< u16 > ids

Member Function Documentation

◆ clear()

void TestServerActiveObjectMgr::clear ( )
inline

References ids, and saomgr.

Referenced by TEST_CASE().

Here is the caller graph for this function:

◆ compareObjects()

void TestServerActiveObjectMgr::compareObjects ( std::vector< ServerActiveObject * > & actual,
std::vector< ServerActiveObject * > & expected )
inline

References compare_by_id, and sortById().

Referenced by compareObjectsInArea(), and compareObjectsInsideRadius().

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

◆ compareObjectsInArea()

void TestServerActiveObjectMgr::compareObjectsInArea ( const aabb3f & box)
inline

References compareObjects(), getObjectsInAreaNaive(), and saomgr.

Referenced by TEST_CASE().

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

◆ compareObjectsInsideRadius()

void TestServerActiveObjectMgr::compareObjectsInsideRadius ( const v3f & pos,
float radius )
inline

References compareObjects(), getObjectsInsideRadiusNaive(), and saomgr.

Referenced by TEST_CASE().

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

◆ empty()

bool TestServerActiveObjectMgr::empty ( )
inline

References ids.

Referenced by TEST_CASE().

Here is the caller graph for this function:

◆ getActiveObject()

ServerActiveObject * TestServerActiveObjectMgr::getActiveObject ( u16 id)
inline

References saomgr.

Referenced by TEST_CASE().

Here is the caller graph for this function:

◆ getAddedActiveObjectsAroundPos()

template<class T>
void TestServerActiveObjectMgr::getAddedActiveObjectsAroundPos ( T && arg)
inline

References saomgr.

◆ getFreeId()

u16 TestServerActiveObjectMgr::getFreeId ( ) const
inline

References saomgr.

Referenced by TEST_CASE().

Here is the caller graph for this function:

◆ getObjectsInAreaNaive()

void TestServerActiveObjectMgr::getObjectsInAreaNaive ( const aabb3f & box,
std::vector< ServerActiveObject * > & result )
inline

References saomgr.

Referenced by compareObjectsInArea().

Here is the caller graph for this function:

◆ getObjectsInsideRadius()

template<class T>
void TestServerActiveObjectMgr::getObjectsInsideRadius ( T && arg)
inline

References saomgr.

◆ getObjectsInsideRadiusNaive()

void TestServerActiveObjectMgr::getObjectsInsideRadiusNaive ( const v3f & pos,
float radius,
std::vector< ServerActiveObject * > & result )
inline

References saomgr.

Referenced by compareObjectsInsideRadius().

Here is the caller graph for this function:

◆ randomId()

template<class T>
u16 TestServerActiveObjectMgr::randomId ( T & random)
inline

References ids.

Referenced by TEST_CASE().

Here is the caller graph for this function:

◆ registerObject()

bool TestServerActiveObjectMgr::registerObject ( std::unique_ptr< ServerActiveObject > obj)
inline

References ids, and saomgr.

Referenced by TEST_CASE().

Here is the caller graph for this function:

◆ removeObject()

void TestServerActiveObjectMgr::removeObject ( u16 id)
inline

References ids, and saomgr.

Referenced by TEST_CASE().

Here is the caller graph for this function:

◆ sortById()

void TestServerActiveObjectMgr::sortById ( std::vector< ServerActiveObject * > & saos)
inlinestatic

References compare_by_id.

Referenced by compareObjects().

Here is the caller graph for this function:

◆ updateObjectPos()

void TestServerActiveObjectMgr::updateObjectPos ( u16 id,
const v3f & pos )
inline

References saomgr.

Referenced by TEST_CASE().

Here is the caller graph for this function:

Member Data Documentation

◆ compare_by_id

auto TestServerActiveObjectMgr::compare_by_id
staticconstexpr
Initial value:
= [](auto *sao1, auto *sao2) -> bool {
return sao1->getId() < sao2->getId();
}

Referenced by compareObjects(), and sortById().

◆ ids

std::vector<u16> TestServerActiveObjectMgr::ids
private

◆ saomgr


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