diff options
Diffstat (limited to 'src/world.cpp')
-rw-r--r-- | src/world.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/world.cpp b/src/world.cpp index 9c3f8276..6749210a 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -199,4 +199,15 @@ void world::throw_on_wrong_entity_type(object_id id, entity_type actual, entity_ fm_throw("object '{}' has wrong entity type '{}', should be '{}'"_cf, id, (size_t)actual, (size_t)expected); } +auto world::neighbors(floormat::chunk_coords_ coord) -> std::array<neighbor_pair, 8> +{ + std::array<neighbor_pair, 8> ret; + for (auto i = 0uz; const auto& x : neighbor_offsets) + { + auto ch = coord + x; + ret[i++] = { at(ch), ch }; + } + return ret; +} + } // namespace floormat |