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

Public Member Functions

 TestMap ()
const char * getName ()
void runTests (IGameDef *gamedef)
void testMaxMapgenLimit ()
void testForEachNodeInArea (IGameDef *gamedef)
void testForEachNodeInAreaBlank (IGameDef *gamedef)
void testForEachNodeInAreaEmpty (IGameDef *gamedef)
Public Member Functions inherited from Map
 Map (IGameDef *gamedef)
virtual ~Map ()
 DISABLE_CLASS_COPY (Map)
void addEventReceiver (MapEventReceiver *event_receiver)
void removeEventReceiver (MapEventReceiver *event_receiver)
void dispatchEvent (const MapEditEvent &event)
MapSectorgetSectorNoGenerateNoLock (v2s16 p2d)
MapSectorgetSectorNoGenerate (v2s16 p2d)
virtual MapSectoremergeSector (v2s16 p)
MapBlockgetBlockNoCreate (v3s16 p)
MapBlockgetBlockNoCreateNoEx (v3s16 p)
virtual MapBlockemergeBlock (v3s16 p, bool create_blank=true)
const NodeDefManagergetNodeDefManager ()
bool isValidPosition (v3s16 p)
void setNode (v3s16 p, MapNode n)
MapNode getNode (v3s16 p, bool *is_valid_position=NULL)
virtual void addNodeAndUpdate (v3s16 p, MapNode n, std::map< v3s16, MapBlock * > &modified_blocks, bool remove_metadata=true)
void removeNodeAndUpdate (v3s16 p, std::map< v3s16, MapBlock * > &modified_blocks)
bool addNodeWithEvent (v3s16 p, MapNode n, bool remove_metadata=true)
bool removeNodeWithEvent (v3s16 p)
virtual void beginSave ()
virtual void endSave ()
virtual void save (ModifiedState save_level)
virtual bool maySaveBlocks ()
virtual bool saveBlock (MapBlock *block)
virtual bool deleteBlock (v3s16 blockpos)
void timerUpdate (float dtime, float unload_timeout, s32 max_loaded_blocks, std::vector< v3s16 > *unloaded_blocks=NULL)
void unloadUnreferencedBlocks (std::vector< v3s16 > *unloaded_blocks=NULL)
void deleteSectors (const std::vector< v2s16 > &list)
virtual void PrintInfo (std::ostream &out)
std::vector< v3s16findNodesWithMetadata (v3s16 p1, v3s16 p2)
NodeMetadatagetNodeMetadata (v3s16 p)
bool setNodeMetadata (v3s16 p, NodeMetadata *meta)
 Sets metadata for a node.
void removeNodeMetadata (v3s16 p)
NodeTimer getNodeTimer (v3s16 p)
void setNodeTimer (const NodeTimer &t)
void removeNodeTimer (v3s16 p)
template<typename F>
void forEachNodeInArea (v3s16 minp, v3s16 maxp, F func)
bool isBlockOccluded (MapBlock *block, v3s16 cam_pos_nodes)
bool isBlockOccluded (v3s16 pos_relative, v3s16 cam_pos_nodes, bool simple_check=false)
Public Member Functions inherited from TestBase
bool testModule (IGameDef *gamedef)
std::string getTestTempDirectory ()
std::string getTestTempFile ()
void runTest (const char *name, std::function< void()> &&test)

Additional Inherited Members

Public Attributes inherited from TestBase
u32 num_tests_failed
u32 num_tests_run
Protected Member Functions inherited from Map
virtual void reportMetrics (u64 save_time_us, u32 saved_blocks, u32 all_blocks)
bool determineAdditionalOcclusionCheck (v3s16 pos_camera, const core::aabbox3d< s16 > &block_bounds, v3s16 &to_check)
bool isOccluded (v3s16 pos_camera, v3s16 pos_target, float step, float stepfac, float start_offset, float end_offset, u32 needed_count)
Protected Attributes inherited from Map
IGameDefm_gamedef
std::set< MapEventReceiver * > m_event_receivers
std::unordered_map< v2s16, MapSector * > m_sectors
MapSectorm_sector_cache = nullptr
v2s16 m_sector_cache_p
const NodeDefManagerm_nodedef

Constructor & Destructor Documentation

◆ TestMap()

TestMap::TestMap ( )
inline

References TestManager::registerTestModule().

Here is the call graph for this function:

Member Function Documentation

◆ getName()

const char * TestMap::getName ( )
inlinevirtual

Implements TestBase.

◆ runTests()

void TestMap::runTests ( IGameDef * gamedef)
virtual

Implements TestBase.

References runTests(), TEST, testForEachNodeInArea(), testForEachNodeInAreaBlank(), testForEachNodeInAreaEmpty(), and testMaxMapgenLimit().

Referenced by runTests().

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

◆ testForEachNodeInArea()

void TestMap::testForEachNodeInArea ( IGameDef * gamedef)

References CONTENT_AIR, CONTENT_IGNORE, Map::forEachNodeInArea(), MapNode::getContent(), getNodeBlockPos(), p(), Map::setNode(), t_CONTENT_LAVA, t_CONTENT_STONE, t_CONTENT_TORCH, t_CONTENT_WATER, testForEachNodeInArea(), UASSERT, and UASSERTEQ.

Referenced by runTests(), and testForEachNodeInArea().

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

◆ testForEachNodeInAreaBlank()

void TestMap::testForEachNodeInAreaBlank ( IGameDef * gamedef)

References Map::forEachNodeInArea(), Map::getNode(), p(), testForEachNodeInAreaBlank(), and UASSERT.

Referenced by runTests(), and testForEachNodeInAreaBlank().

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

◆ testForEachNodeInAreaEmpty()

void TestMap::testForEachNodeInAreaEmpty ( IGameDef * gamedef)

References Map::forEachNodeInArea(), p(), testForEachNodeInAreaEmpty(), and UASSERT.

Referenced by runTests(), and testForEachNodeInAreaEmpty().

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

◆ testMaxMapgenLimit()

void TestMap::testMaxMapgenLimit ( )

References blockpos_over_max_limit(), BS, MAP_BLOCKSIZE, MAX_MAP_GENERATION_LIMIT, objectpos_over_limit(), testMaxMapgenLimit(), UASSERT, and UASSERTEQ.

Referenced by runTests(), and testMaxMapgenLimit().

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 file: