]> git.tdb.fi Git - libs/game.git/blob - source/game/meshsource.h
Decorate things which constitute the public API of the library
[libs/game.git] / source / game / meshsource.h
1 #ifndef MSP_GAME_MESHSOURCE_H_
2 #define MSP_GAME_MESHSOURCE_H_
3
4 #include <msp/datafile/objectloader.h>
5 #include "component.h"
6 #include "mspgame_api.h"
7
8 namespace Msp::Game {
9
10 struct MeshSourceSetup
11 {
12         class Loader: public DataFile::ObjectLoader<MeshSourceSetup>
13         {
14         private:
15                 static Loader::ActionMap shared_actions;
16
17         public:
18                 Loader(MeshSourceSetup &);
19
20         protected:
21                 void init_actions() override;
22         };
23
24         std::string object_name;
25 };
26
27 class MSPGAME_API MeshSource: public Component
28 {
29 public:
30         using Setup = MeshSourceSetup;
31
32 private:
33         const Setup &setup;
34
35 public:
36         MeshSource(Handle<Entity> e, const Setup &s): Component(e), setup(s) { }
37
38         const std::string &get_object_name() const { return setup.object_name; }
39 };
40
41 } // namespace Msp::Game
42
43 #endif