summaryrefslogtreecommitdiffstats
path: root/src/ChunkDef.h
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2018-07-24 23:30:49 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2018-07-24 23:30:49 +0200
commitc94d7184ebaf7e8540f717c70c1e03ae62e5a7bd (patch)
tree3a373f8ea6f06dc9b117d2d103bfaee5705040b8 /src/ChunkDef.h
parentStop cFunctionRef constructor from disabling default copy constructor. (#4173) (diff)
downloadcuberite-c94d7184ebaf7e8540f717c70c1e03ae62e5a7bd.tar
cuberite-c94d7184ebaf7e8540f717c70c1e03ae62e5a7bd.tar.gz
cuberite-c94d7184ebaf7e8540f717c70c1e03ae62e5a7bd.tar.bz2
cuberite-c94d7184ebaf7e8540f717c70c1e03ae62e5a7bd.tar.lz
cuberite-c94d7184ebaf7e8540f717c70c1e03ae62e5a7bd.tar.xz
cuberite-c94d7184ebaf7e8540f717c70c1e03ae62e5a7bd.tar.zst
cuberite-c94d7184ebaf7e8540f717c70c1e03ae62e5a7bd.zip
Diffstat (limited to '')
-rw-r--r--src/ChunkDef.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/ChunkDef.h b/src/ChunkDef.h
index 3807ae1aa..d73bd4198 100644
--- a/src/ChunkDef.h
+++ b/src/ChunkDef.h
@@ -71,6 +71,33 @@ public:
+/** Non-owning view of a chunk's client handles. */
+class cChunkClientHandles
+{
+public:
+ using const_iterator = std::vector<cClientHandle *>::const_iterator;
+ using iterator = const_iterator;
+
+ explicit cChunkClientHandles(const std::vector<cClientHandle *> & a_Container):
+ m_Begin(a_Container.cbegin()),
+ m_End(a_Container.cend())
+ {
+ }
+
+ const_iterator begin() const { return m_Begin; }
+ const_iterator cbegin() const { return m_Begin; }
+
+ const_iterator end() const { return m_End; }
+ const_iterator cend() const { return m_End; }
+
+private:
+ const_iterator m_Begin, m_End;
+};
+
+
+
+
+
/** Constants used throughout the code, useful typedefs and utility functions */
class cChunkDef
{