summaryrefslogtreecommitdiff
path: root/src/package.cpp
blob: 379aaebf4cf5de97016062e98b2e826025b6b9c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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; }
}