aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/interface/GFXObject.hpp
blob: 840e4a9004406deef8421de03cbc67ed948f7888 (plain) (blame)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#pragma once

#include "openvic-simulation/interface/LoadBase.hpp"

namespace OpenVic::GFX {

   class Object : public Named<> {
   protected:
      Object() = default;

   public:
      Object(Object&&) = default;
      virtual ~Object() = default;

      OV_DETAIL_GET_BASE_TYPE(Object)
      OV_DETAIL_GET_TYPE

      static NodeTools::node_callback_t expect_objects(
         NodeTools::length_callback_t length_callback, NodeTools::callback_t<std::unique_ptr<Object>&&> callback
      );
   };

   class Actor final : public Object {
      friend std::unique_ptr<Actor> std::make_unique<Actor>();

   public:
      class Attachment : public Named<> {
         friend class LoadBase;

      private:
         std::string PROPERTY(node);
         int32_t PROPERTY(attach_id);

      protected:
         Attachment();

         bool _fill_key_map(NodeTools::case_insensitive_key_map_t& key_map) override;

      public:
         Attachment(Attachment&&) = default;
         virtual ~Attachment() = default;
      };

      class Animation : public Named<> {
         friend class LoadBase;

         std::string PROPERTY(file);
         fixed_point_t PROPERTY(default_time);

      protected:
         Animation();

         bool _fill_key_map(NodeTools::case_insensitive_key_map_t& key_map) override;

      public:
         Animation(Animation&&) = default;
         virtual ~Animation() = default;
      };

   private:
      std::string PROPERTY(model_file);
      std::string PROPERTY(idle_animation_file);
      std::string PROPERTY(move_animation_file);
      std::string PROPERTY(attack_animation_file);
      fixed_point_t PROPERTY(scale);

      NamedRegistry<Attachment> IDENTIFIER_REGISTRY(attachment);
      NamedRegistry<Animation> IDENTIFIER_REGISTRY(animation);

   protected:
      Actor();

      bool _fill_key_map(NodeTools::case_insensitive_key_map_t& key_map) override;

   public:
      Actor(Actor&&) = default;
      virtual ~Actor() = default;

      OV_DETAIL_GET_TYPE
   };
}