summaryrefslogtreecommitdiff
path: root/src/package.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/package.cpp')
-rw-r--r--src/package.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/package.cpp b/src/package.cpp
new file mode 100644
index 0000000..a9d51b8
--- /dev/null
+++ b/src/package.cpp
@@ -0,0 +1,29 @@
+#include "package.hpp"
+
+#include <algorithm>
+
+namespace silly::editor {
+ Tileset &LevelPackage::get_tileset() { return this->tileset; }
+
+ void LevelPackage::add_level(TileLevel level) {
+ this->levels.push_back(level);
+ }
+
+ TileLevel &LevelPackage::get_current_level() {
+ return this->levels.at(this->currentLevelIndex);
+ }
+
+ void LevelPackage::move_to_level_index(int index) {
+ this->currentLevelIndex = std::min(index, (int)this->levels.size() - 1);
+ }
+
+ const int LevelPackage::get_current_level_index() const {
+ return this->currentLevelIndex;
+ }
+
+ const std::vector<TileLevel> &LevelPackage::get_levels() const {
+ return this->levels;
+ }
+
+ const std::string &LevelPackage::get_name() const { return this->name; }
+} \ No newline at end of file