summaryrefslogtreecommitdiffstats
path: root/src/BlockTracer.h
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2016-02-06 11:37:34 +0100
committerJulian Laubstein <julianlaubstein@yahoo.de>2016-02-06 11:37:34 +0100
commit6fdd7194c81be7234a126bdc3b48f0291fce3567 (patch)
tree7d5ac74b7385ce4ebf77588d80549c884c2b993c /src/BlockTracer.h
parentMerge pull request #2958 from LogicParrot/fence (diff)
parentBulk clearing of whitespace (diff)
downloadcuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.gz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.bz2
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.lz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.xz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.zst
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.zip
Diffstat (limited to 'src/BlockTracer.h')
-rw-r--r--src/BlockTracer.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/BlockTracer.h b/src/BlockTracer.h
index ebc0668ee..7444af488 100644
--- a/src/BlockTracer.h
+++ b/src/BlockTracer.h
@@ -30,12 +30,12 @@ public:
public:
// Force a virtual destructor in descendants:
virtual ~cCallbacks() {}
-
+
/** Called on each block encountered along the path, including the first block (path start)
When this callback returns true, the tracing is aborted.
*/
virtual bool OnNextBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, char a_EntryFace) = 0;
-
+
/** Called on each block encountered along the path, including the first block (path start), if chunk data is not loaded
When this callback returns true, the tracing is aborted.
*/
@@ -47,7 +47,7 @@ public:
UNUSED(a_EntryFace);
return false;
}
-
+
/** Called when the path goes out of world, either below (a_BlockY < 0) or above (a_BlockY >= cChunkDef::Height)
The coords specify the exact point at which the path exited the world.
If this callback returns true, the tracing is aborted.
@@ -61,7 +61,7 @@ public:
UNUSED(a_BlockZ);
return false;
}
-
+
/** Called when the path goes into the world, from either below (a_BlockY < 0) or above (a_BlockY >= cChunkDef::Height)
The coords specify the exact point at which the path entered the world.
If this callback returns true, the tracing is aborted.
@@ -75,27 +75,27 @@ public:
UNUSED(a_BlockZ);
return false;
}
-
+
/** Called when the path is sure not to hit any more blocks.
Note that for some shapes this might never happen (line with constant Y)
*/
virtual void OnNoMoreHits(void) {}
-
+
/** Called when the block tracing walks into a chunk that is not allocated.
This usually means that the tracing is aborted.
*/
virtual void OnNoChunk(void) {}
} ;
-
-
+
+
/** Creates the BlockTracer parent with the specified callbacks */
cBlockTracer(cWorld & a_World, cCallbacks & a_Callbacks) :
m_World(&a_World),
m_Callbacks(&a_Callbacks)
{
}
-
-
+
+
/** Sets new world, returns the old one. Note that both need to be valid */
cWorld & SetWorld(cWorld & a_World)
{
@@ -103,8 +103,8 @@ public:
m_World = &a_World;
return Old;
}
-
-
+
+
/** Sets new callbacks, returns the old ones. Note that both need to be valid */
cCallbacks & SetCallbacks(cCallbacks & a_NewCallbacks)
{
@@ -112,11 +112,11 @@ public:
m_Callbacks = &a_NewCallbacks;
return Old;
}
-
+
protected:
/** The world upon which to operate */
cWorld * m_World;
-
+
/** The callback to use for reporting */
cCallbacks * m_Callbacks;
} ;