diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-19 15:03:59 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-20 15:37:22 +0100 |
commit | fff6a131ccadee9dcbd7f213e1846a0095f526e1 (patch) | |
tree | 199dee817f35460c2a48bc8aecfa403b33a02cd0 /src | |
parent | 3264ef85e50add2db3c54291540bde7e8411cb70 (diff) |
w
Diffstat (limited to 'src')
-rw-r--r-- | src/chunk.cpp | 2 | ||||
-rw-r--r-- | src/chunk.hpp | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/chunk.cpp b/src/chunk.cpp index 8674eb9f..dcb7d030 100644 --- a/src/chunk.cpp +++ b/src/chunk.cpp @@ -45,6 +45,8 @@ tile_proto chunk::operator[](size_t idx) const noexcept { return tile_proto(tile tile_ref chunk::operator[](local_coords xy) noexcept { return operator[](xy.to_index()); } tile_proto chunk::operator[](local_coords xy) const noexcept { return operator[](xy.to_index()); } +chunk_coords_ chunk::coord() const noexcept { return _coord; } + tile_ref chunk::at_offset(local_coords pos, Vector2i off) { const auto coord = global_coords{_coord, pos}; diff --git a/src/chunk.hpp b/src/chunk.hpp index 968be089..6833ab03 100644 --- a/src/chunk.hpp +++ b/src/chunk.hpp @@ -47,6 +47,7 @@ struct chunk final tile_ref operator[](local_coords xy) noexcept; tile_proto operator[](local_coords xy) const noexcept; + chunk_coords_ coord() const noexcept; tile_ref at_offset(local_coords pos, Vector2i off); tile_ref at_offset(tile_ref r, Vector2i off); Optional<tile_ref> at_offset_(local_coords pos, Vector2i off); |