From 5f8caec1e2762568e8e3845f13e980dce8cf13f1 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sun, 2 Feb 2025 03:59:39 +0500 Subject: feat: show what level and floor is selected --- src/level.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/level.cpp') diff --git a/src/level.cpp b/src/level.cpp index 8e9ba81..efc2038 100644 --- a/src/level.cpp +++ b/src/level.cpp @@ -72,6 +72,15 @@ namespace silly::editor { const int TileFloor::get_width() const { return this->width; } const int TileFloor::get_height() const { return this->height; } + const int TileFloor::get_tile_count() const { + int count = 0; + + std::for_each(this->layers.begin(), this->layers.end(), + [&count](const TileLayer &l) { count += l.tiles.size(); }); + + return count; + } + void TileLevel::add_floor(TileFloor floor) { this->floors.push_back(floor); } void TileLevel::move_to_floor(int floor_id) { @@ -82,6 +91,10 @@ namespace silly::editor { return this->floors.at(this->current_floor); } + const int &TileLevel::get_current_floor_index() const { + return this->current_floor; + } + const std::vector &TileLevel::get_floors() const { return this->floors; } -- cgit v1.2.3