diff options
author | ShadowNinja <shadowninja@minetest.net> | 2015-10-30 20:38:22 -0400 |
---|---|---|
committer | ShadowNinja <shadowninja@minetest.net> | 2016-03-07 16:33:20 -0500 |
commit | 3ce6642a26d43fd368c24cdfc5460557258fb44f (patch) | |
tree | 3f84e8a4491abc6c9bc4a615dea018fdd8cf0697 /src/util/areastore.h | |
parent | 821551a2669123ac9a476894d65b5efe10026040 (diff) | |
download | minetest-3ce6642a26d43fd368c24cdfc5460557258fb44f.tar.gz minetest-3ce6642a26d43fd368c24cdfc5460557258fb44f.tar.bz2 minetest-3ce6642a26d43fd368c24cdfc5460557258fb44f.zip |
Add AreaStore custom ID API
Diffstat (limited to 'src/util/areastore.h')
-rw-r--r-- | src/util/areastore.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/util/areastore.h b/src/util/areastore.h index ab6bd76a3..bebecfd78 100644 --- a/src/util/areastore.h +++ b/src/util/areastore.h @@ -38,9 +38,9 @@ with this program; if not, write to the Free Software Foundation, Inc., struct Area { - Area() {} + Area() : id(U32_MAX) {} Area(const v3s16 &mine, const v3s16 &maxe) : - minedge(mine), maxedge(maxe) + id(U32_MAX), minedge(mine), maxedge(maxe) { sortBoxVerticies(minedge, maxedge); } @@ -68,7 +68,8 @@ public: size_t size() const { return areas_map.size(); } /// Add an area to the store. - /// Updates the area's ID. + /// Updates the area's ID if it hasn't already been set. + /// @return Whether the area insertion was successful. virtual bool insertArea(Area *a) = 0; /// Removes an area from the store by ID. |