1 #pragma once
2 #include "gate.hpp"
3 #include "nlohmann/json_fwd.hpp"
4 #include "unit.hpp"
5 #include "util/uuid.hpp"
6 #include <fstream>
7 #include <map>
8 #include <vector>
9 #include "util/file_version.hpp"
10 
11 namespace horizon {
12 using json = nlohmann::json;
13 
14 class Entity {
15 private:
16     Entity(const UUID &uu, const json &, class IPool &pool);
17 
18 public:
19     Entity(const UUID &uu);
20 
21     static Entity new_from_file(const std::string &filename, IPool &pool);
22     static unsigned int get_app_version();
23     UUID uuid;
24     std::string name;
25     std::string manufacturer;
26     std::string prefix;
27     std::set<std::string> tags;
28     std::map<UUID, Gate> gates;
29 
30     FileVersion version;
31     json serialize() const;
32     void update_refs(IPool &pool);
33     UUID get_uuid() const;
34 };
35 } // namespace horizon
36