summaryrefslogtreecommitdiff
path: root/src/level.cpp
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-02-02 03:59:39 +0500
committerilotterytea <iltsu@alright.party>2025-02-02 03:59:39 +0500
commit5f8caec1e2762568e8e3845f13e980dce8cf13f1 (patch)
tree667469539cca73c99362611075d7020b1d2b6e99 /src/level.cpp
parentd8d3cfb04e7801ca726fead4eeb34365b4e20082 (diff)
feat: show what level and floor is selected
Diffstat (limited to 'src/level.cpp')
-rw-r--r--src/level.cpp13
1 files changed, 13 insertions, 0 deletions
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<TileFloor> &TileLevel::get_floors() const {
return this->floors;
}