summaryrefslogtreecommitdiffstats
path: root/Tools/AnvilStats/Callback.h
diff options
context:
space:
mode:
authorAlexander Lyons Harkness <me@bearbin.net>2017-12-23 13:49:08 +0100
committerAlexander Lyons Harkness <me@bearbin.net>2017-12-24 15:23:23 +0100
commit1926181cb7c8570fe57ec1b39d4241b9dd156333 (patch)
tree8ac9c6f24285846fa3f97f0a4ade9b0f9996f295 /Tools/AnvilStats/Callback.h
parentFixed item ID raw rabbit (#4103) (diff)
downloadcuberite-1926181cb7c8570fe57ec1b39d4241b9dd156333.tar
cuberite-1926181cb7c8570fe57ec1b39d4241b9dd156333.tar.gz
cuberite-1926181cb7c8570fe57ec1b39d4241b9dd156333.tar.bz2
cuberite-1926181cb7c8570fe57ec1b39d4241b9dd156333.tar.lz
cuberite-1926181cb7c8570fe57ec1b39d4241b9dd156333.tar.xz
cuberite-1926181cb7c8570fe57ec1b39d4241b9dd156333.tar.zst
cuberite-1926181cb7c8570fe57ec1b39d4241b9dd156333.zip
Diffstat (limited to 'Tools/AnvilStats/Callback.h')
-rw-r--r--Tools/AnvilStats/Callback.h66
1 files changed, 31 insertions, 35 deletions
diff --git a/Tools/AnvilStats/Callback.h b/Tools/AnvilStats/Callback.h
index eda4a8478..9b6554a8d 100644
--- a/Tools/AnvilStats/Callback.h
+++ b/Tools/AnvilStats/Callback.h
@@ -37,39 +37,39 @@ public:
CALLBACK_CONTINUE = false,
CALLBACK_ABORT = true,
} ;
-
+
virtual ~cCallback() {} // Force a virtual destructor in each descendant
- /// Called when a new region file is about to be opened; by default allow the region
+ /** Called when a new region file is about to be opened; by default allow the region */
virtual bool OnNewRegion(int a_RegionX, int a_RegionZ) { return CALLBACK_CONTINUE; }
-
- /// Called to inform the stats module of the chunk coords for newly processing chunk
+
+ /** Called to inform the stats module of the chunk coords for newly processing chunk */
virtual bool OnNewChunk(int a_ChunkX, int a_ChunkZ) = 0;
-
- /// Called to inform about the chunk's data offset in the file (chunk mini-header), the number of sectors it uses and the timestamp field value
+
+ /** Called to inform about the chunk's data offset in the file (chunk mini-header), the number of sectors it uses and the timestamp field value */
virtual bool OnHeader(int a_FileOffset, unsigned char a_NumSectors, int a_Timestamp) { return CALLBACK_ABORT; }
-
- /// Called to inform of the compressed chunk data size and position in the file (offset from file start to the actual data)
+
+ /** Called to inform of the compressed chunk data size and position in the file (offset from file start to the actual data) */
virtual bool OnCompressedDataSizePos(int a_CompressedDataSize, int a_DataOffset, char a_CompressionMethod) { return CALLBACK_ABORT; }
-
- /// Just in case you wanted to process the NBT yourself ;)
+
+ /** Just in case you wanted to process the NBT yourself ;) */
virtual bool OnDecompressedData(const char * a_DecompressedNBT, int a_DataSize) { return CALLBACK_ABORT; }
-
- /// The chunk's NBT should specify chunk coords, these are sent here:
+
+ /** The chunk's NBT should specify chunk coords, these are sent here: */
virtual bool OnRealCoords(int a_ChunkX, int a_ChunkZ) { return CALLBACK_ABORT; }
-
- /// The chunk contains a LastUpdate value specifying the last tick in which it was saved.
+
+ /** The chunk contains a LastUpdate value specifying the last tick in which it was saved. */
virtual bool OnLastUpdate(Int64 a_LastUpdate) { return CALLBACK_ABORT; }
-
+
virtual bool OnTerrainPopulated(bool a_Populated) { return CALLBACK_ABORT; }
-
+
virtual bool OnBiomes(const unsigned char * a_BiomeData) { return CALLBACK_ABORT; }
-
+
/** Called when a heightmap for the chunk is read from the file.
Note that the heightmap is given in big-endian ints, so if you want it, you need to ntohl() it first!
*/
virtual bool OnHeightMap(const int * a_HeightMapBE) { return CALLBACK_ABORT; }
-
+
/** If there is data for the section, this callback is called; otherwise OnEmptySection() is called instead.
All OnSection() callbacks are called first, and only then all the remaining sections are reported in OnEmptySection().
*/
@@ -81,16 +81,16 @@ public:
const NIBBLETYPE * a_BlockLight,
const NIBBLETYPE * a_BlockSkyLight
) { return CALLBACK_ABORT; }
-
- /** If there is no data for a section, this callback is called; otherwise OnSection() is called instead.
+
+ /** If there is no data for a section, this callback is called; otherwise OnSection() is called instead.
OnEmptySection() callbacks are called after all OnSection() callbacks.
*/
virtual bool OnEmptySection(unsigned char a_Y) { return CALLBACK_CONTINUE; }
-
+
/** Called after all sections have been processed via either OnSection() or OnEmptySection().
*/
virtual bool OnSectionsFinished(void) { return CALLBACK_ABORT; }
-
+
/** Called for each entity in the chunk.
Common parameters are parsed from the NBT.
The callback may parse any other param from the a_NBT and a_NBTTag parameters.
@@ -108,7 +108,7 @@ public:
cParsedNBT & a_NBT,
int a_NBTTag
) { return CALLBACK_ABORT; }
-
+
/** Called for each tile entity in the chunk.
Common parameters are parsed from the NBT.
The callback may parse any other param from the a_NBT and a_NBTTag parameters.
@@ -121,14 +121,14 @@ public:
int a_NBTTag
) { return CALLBACK_ABORT; }
- /// Called for each tile tick in the chunk
+ /** Called for each tile tick in the chunk */
virtual bool OnTileTick(
int a_BlockType,
int a_TicksLeft,
int a_PosX, int a_PosY, int a_PosZ
) { return CALLBACK_ABORT; }
-
- /// Called after the entire region file has been processed. No more callbacks for this region will be called. No processing by default
+
+ /** Called after the entire region file has been processed. No more callbacks for this region will be called. No processing by default */
virtual void OnRegionFinished(int a_RegionX, int a_RegionZ) {}
} ;
@@ -153,11 +153,11 @@ public:
delete *itr;
}
}
-
- /// Descendants override this method to return the correct callback type
+
+ /** Descendants override this method to return the correct callback type */
virtual cCallback * CreateNewCallback(void) = 0;
-
- /// cProcessor uses this method to request a new callback
+
+ /** cProcessor uses this method to request a new callback */
cCallback * GetNewCallback(void)
{
cCallback * Callback = CreateNewCallback();
@@ -167,11 +167,7 @@ public:
}
return Callback;
}
-
+
protected:
cCallbacks m_Callbacks;
} ;
-
-
-
-