summary refs log tree commit diff
path: root/src/World/Chunk.cpp
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2023-07-21 02:17:03 +0200
committerMel <einebeere@gmail.com>2023-07-21 02:17:03 +0200
commit23d88e5f1c8f0c8652a07050fcfa8ff126e85d4a (patch)
treed2979c12a9675885b7ed969d5f51dbd69d969286 /src/World/Chunk.cpp
parentc0556f76fc5c8271c2eaa7ca91ad1c92c691d8bc (diff)
downloadmeowcraft-23d88e5f1c8f0c8652a07050fcfa8ff126e85d4a.tar.zst
meowcraft-23d88e5f1c8f0c8652a07050fcfa8ff126e85d4a.zip
Extremely simple chunk-limited lighting
Diffstat (limited to 'src/World/Chunk.cpp')
-rw-r--r--src/World/Chunk.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/World/Chunk.cpp b/src/World/Chunk.cpp
index 94e757e..ab727bd 100644
--- a/src/World/Chunk.cpp
+++ b/src/World/Chunk.cpp
@@ -3,16 +3,16 @@
 
 namespace MC::World {
 
-void Chunk::set(U32 x, U32 y, U32 z, BlockData data) {
-    m_blocks.at(pos(x, y, z)) = data;
+const Chunk::BlockData& Chunk::at(U32 x, U32 y, U32 z) const {
+    return m_blocks.at(pos(x, y, z));
 }
 
-Chunk::BlockData Chunk::get(U32 x, U32 y, U32 z) const {
+Chunk::BlockData& Chunk::at(U32 x, U32 y, U32 z) {
     return m_blocks.at(pos(x, y, z));
 }
 
 Bool Chunk::is_empty(U32 x, U32 y, U32 z) const {
-    return get(x, y, z).empty();
+    return at(x, y, z).empty();
 }
 
 Vector<3> Chunk::position() const {