diff options
author | peterbell10 <peterbell10@live.co.uk> | 2017-09-11 23:20:49 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2017-09-11 23:20:49 +0200 |
commit | e225b7f8262df48ad4d7094bc295add3007b0649 (patch) | |
tree | a42e9afcc88cfe6e9d1258458e3ad42764083d0e /src/BlockArea.h | |
parent | cBlockArea: change MakeIndex to return size_t (diff) | |
download | cuberite-e225b7f8262df48ad4d7094bc295add3007b0649.tar cuberite-e225b7f8262df48ad4d7094bc295add3007b0649.tar.gz cuberite-e225b7f8262df48ad4d7094bc295add3007b0649.tar.bz2 cuberite-e225b7f8262df48ad4d7094bc295add3007b0649.tar.lz cuberite-e225b7f8262df48ad4d7094bc295add3007b0649.tar.xz cuberite-e225b7f8262df48ad4d7094bc295add3007b0649.tar.zst cuberite-e225b7f8262df48ad4d7094bc295add3007b0649.zip |
Diffstat (limited to '')
-rw-r--r-- | src/BlockArea.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/BlockArea.h b/src/BlockArea.h index ab7fb8f2c..60a2821bd 100644 --- a/src/BlockArea.h +++ b/src/BlockArea.h @@ -17,13 +17,14 @@ #include "ForEachChunkProvider.h" #include "ChunkDataCallback.h" #include "Cuboid.h" +#include "FunctionRef.h" // fwd: class cCuboid; - +using cBlockEntityCallback = cFunctionRef<bool(cBlockEntity &)>; @@ -379,18 +380,18 @@ public: /** Calls the callback for the block entity at the specified coords. Returns false if there is no block entity at those coords, or the block area doesn't have baBlockEntities. Returns the value that the callback has returned if there is a block entity. */ - bool DoWithBlockEntityRelAt(int a_RelX, int a_RelY, int a_RelZ, cItemCallback<cBlockEntity> & a_Callback); + bool DoWithBlockEntityRelAt(int a_RelX, int a_RelY, int a_RelZ, cBlockEntityCallback a_Callback); /** Calls the callback for the block entity at the specified coords. Returns false if there is no block entity at those coords. Returns the value that the callback has returned if there is a block entity. */ - bool DoWithBlockEntityAt (int a_BlockX, int a_BlockY, int a_BlockZ, cItemCallback<cBlockEntity> & a_Callback); + bool DoWithBlockEntityAt (int a_BlockX, int a_BlockY, int a_BlockZ, cBlockEntityCallback a_Callback); /** Calls the callback for all the block entities. If the callback returns true, aborts the enumeration and returns false. If the callback returns true, continues with the next BE. Returns true if all block entities have been enumerated (including the case when there is none or the area is without baBlockEntities). */ - bool ForEachBlockEntity(cItemCallback<cBlockEntity> & a_Callback); + bool ForEachBlockEntity(cBlockEntityCallback a_Callback); /** Direct read-only access to block entities. */ const cBlockEntities & GetBlockEntities(void) const { ASSERT(HasBlockEntities()); return *m_BlockEntities; } |