summaryrefslogtreecommitdiffstats
path: root/src/ChunkMap.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2017-08-18 12:17:56 +0200
committerGitHub <noreply@github.com>2017-08-18 12:17:56 +0200
commit72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82 (patch)
treec1c1a040332d4ba1f784be25c67c9800e85015eb /src/ChunkMap.h
parentSitting cats block enderchests from opening (#3906) (diff)
parentChanged entity ownership model to use smart pointers (diff)
downloadcuberite-72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82.tar
cuberite-72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82.tar.gz
cuberite-72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82.tar.bz2
cuberite-72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82.tar.lz
cuberite-72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82.tar.xz
cuberite-72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82.tar.zst
cuberite-72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82.zip
Diffstat (limited to 'src/ChunkMap.h')
-rw-r--r--src/ChunkMap.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ChunkMap.h b/src/ChunkMap.h
index 87174e624..e902be60c 100644
--- a/src/ChunkMap.h
+++ b/src/ChunkMap.h
@@ -214,17 +214,18 @@ public:
void RemoveClientFromChunks(cClientHandle * a_Client);
/** Adds the entity to its appropriate chunk, takes ownership of the entity pointer */
- void AddEntity(cEntity * a_Entity);
+ void AddEntity(OwnedEntity a_Entity);
/** Adds the entity to its appropriate chunk, if the entity is not already added.
Takes ownership of the entity pointer */
- void AddEntityIfNotPresent(cEntity * a_Entity);
+ void AddEntityIfNotPresent(OwnedEntity a_Entity);
/** Returns true if the entity with specified ID is present in the chunks */
bool HasEntity(UInt32 a_EntityID);
- /** Removes the entity from its appropriate chunk */
- void RemoveEntity(cEntity * a_Entity);
+ /** Removes the entity from its appropriate chunk
+ Returns an owning reference to the found entity. */
+ OwnedEntity RemoveEntity(cEntity & a_Entity);
/** Calls the callback for each entity in the entire world; returns true if all entities processed, false if the callback aborted by returning true */
bool ForEachEntity(cEntityCallback & a_Callback); // Lua-accessible