diff options
author | zaaarf <me@zaaarf.foo> | 2023-12-10 23:15:41 +0100 |
---|---|---|
committer | zaaarf <me@zaaarf.foo> | 2023-12-10 23:15:41 +0100 |
commit | 4ef33d4df6198e613b0f27406d49978c8ea2fb97 (patch) | |
tree | 7f07835485b877f3c01c52c188892499e5812f9b /src/openvic-simulation/interface/UI.hpp | |
parent | 1eb28bd4fb959b69a30013f6438f0257a2ee7b03 (diff) |
feat: improved identifier registry macro
Diffstat (limited to 'src/openvic-simulation/interface/UI.hpp')
-rw-r--r-- | src/openvic-simulation/interface/UI.hpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/openvic-simulation/interface/UI.hpp b/src/openvic-simulation/interface/UI.hpp index 045766b..12eadb5 100644 --- a/src/openvic-simulation/interface/UI.hpp +++ b/src/openvic-simulation/interface/UI.hpp @@ -4,21 +4,14 @@ namespace OpenVic { - class UIManager { - - NamedInstanceRegistry<GFX::Sprite> sprites; - NamedInstanceRegistry<GUI::Scene, UIManager const&> scenes; - IdentifierRegistry<GFX::Font> fonts; + class UIManager { + NamedInstanceRegistry<GFX::Sprite> IDENTIFIER_REGISTRY(sprite); + NamedInstanceRegistry<GUI::Scene, UIManager const&> IDENTIFIER_REGISTRY(scene); + IdentifierRegistry<GFX::Font> IDENTIFIER_REGISTRY(font); bool _load_font(ast::NodeCPtr node); public: - UIManager(); - - IDENTIFIER_REGISTRY_ACCESSORS(sprite) - IDENTIFIER_REGISTRY_ACCESSORS(scene) - IDENTIFIER_REGISTRY_ACCESSORS(font) - bool add_font(std::string_view identifier, colour_t colour, std::string_view fontname); bool load_gfx_file(ast::NodeCPtr root); |