diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2020-08-08 19:22:16 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2020-08-08 19:22:16 +0200 |
commit | 40eba5244ddd7045a9c3539c5f46c9921301ed90 (patch) | |
tree | 9edf40e2e5033ad19ce8a0739668500e30de653e /src/Simulator/Simulator.cpp | |
parent | const-ify some Chunk functions (diff) | |
download | cuberite-40eba5244ddd7045a9c3539c5f46c9921301ed90.tar cuberite-40eba5244ddd7045a9c3539c5f46c9921301ed90.tar.gz cuberite-40eba5244ddd7045a9c3539c5f46c9921301ed90.tar.bz2 cuberite-40eba5244ddd7045a9c3539c5f46c9921301ed90.tar.lz cuberite-40eba5244ddd7045a9c3539c5f46c9921301ed90.tar.xz cuberite-40eba5244ddd7045a9c3539c5f46c9921301ed90.tar.zst cuberite-40eba5244ddd7045a9c3539c5f46c9921301ed90.zip |
Diffstat (limited to 'src/Simulator/Simulator.cpp')
-rw-r--r-- | src/Simulator/Simulator.cpp | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/src/Simulator/Simulator.cpp b/src/Simulator/Simulator.cpp index e55b77f0f..6b39b81d5 100644 --- a/src/Simulator/Simulator.cpp +++ b/src/Simulator/Simulator.cpp @@ -10,6 +10,90 @@ +std::array<Vector3i, 5> cSimulator::GetLinkedOffsets(const Vector3i Offset) +{ + if (Offset.x == -1) + { + return + { + { + { -2, 0, 0 }, + { -1, -1, 0 }, + { -1, 1, 0 }, + { -1, 0, -1 }, + { -1, 0, 1 } + } + }; + } + else if (Offset.x == 1) + { + return + { + { + { 2, 0, 0 }, + { 1, -1, 0 }, + { 1, 1, 0 }, + { 1, 0, -1 }, + { 1, 0, 1 } + } + }; + } + else if (Offset.y == -1) + { + return + { + { + { 0, -2, 0 }, + { -1, -1, 0 }, + { 1, -1, 0 }, + { 0, -1, -1 }, + { 0, -1, 1 } + } + }; + } + else if (Offset.y == 1) + { + return + { + { + { 0, 2, 0 }, + { -1, 1, 0 }, + { 1, 1, 0 }, + { 0, 1, -1 }, + { 0, 1, 1 } + } + }; + } + else if (Offset.z == -1) + { + return + { + { + { 0, 0, -2 }, + { -1, 0, -1 }, + { 1, 0, -1 }, + { 0, -1, -1 }, + { 0, 1, -1 } + } + }; + } + + return + { + { + { 0, 0, 2 }, + { -1, 0, 1 }, + { 1, 0, 1 }, + { 0, -1, 1 }, + { 0, 1, 1 } + } + }; +} + + + + + void cSimulator::WakeUp(cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_Block) { ASSERT(a_Chunk.IsValid()); |