]> git.localhorst.tv Git - blank.git/blob - src/model/Skeletons.hpp
90affd333d58e0d8891013069f0f1e4b725edd58
[blank.git] / src / model / Skeletons.hpp
1 #ifndef BLANK_MODEL_SKELETONS_HPP_
2 #define BLANK_MODEL_SKELETONS_HPP_
3
4 #include <cstdint>
5 #include <memory>
6 #include <vector>
7
8
9 namespace blank {
10
11 class Model;
12 class EntityMesh;
13 class ShapeRegistry;
14 class TextureIndex;
15
16 class Skeletons {
17
18 public:
19         using size_type = std::size_t;
20         using reference = Model &;
21         using const_reference = const Model &;
22
23 public:
24         Skeletons();
25         ~Skeletons();
26
27         void LoadHeadless();
28         void Load(const ShapeRegistry &, TextureIndex &);
29
30         size_type size() const noexcept { return skeletons.size(); }
31
32         reference operator[](size_type i) noexcept { return *skeletons[i]; }
33         const_reference operator[](size_type i) const noexcept { return *skeletons[i]; }
34
35         Model *ByID(std::uint16_t) noexcept;
36         const Model *ByID(std::uint16_t) const noexcept;
37
38 private:
39         std::vector<std::unique_ptr<Model>> skeletons;
40         std::vector<EntityMesh> meshes;
41
42 };
43
44 }
45
46 #endif