aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nemrav <>2024-09-05 22:38:19 +0200
committer Nemrav <>2024-09-05 22:38:19 +0200
commitfa4295e1f2cbb0b7df2a5ded82c5c8762cb9d960 (patch)
tree2989437005555916cc5bf8d9c942f8e67c49fda0
parent9d30f3eeeff56297f61a33348658b970cf191964 (diff)
in progress format type
-rw-r--r--src/openvic-simulation/types/Format.hpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/openvic-simulation/types/Format.hpp b/src/openvic-simulation/types/Format.hpp
new file mode 100644
index 0000000..301ffa6
--- /dev/null
+++ b/src/openvic-simulation/types/Format.hpp
@@ -0,0 +1,40 @@
+#pragma once
+
+#include "openvic-simulation/types/IdentifierRegistry.hpp"
+#include <openvic-simulation/dataloader/NodeTools.hpp>
+//#include "openvic-simulation/interface/GFXSprite.hpp"
+
+using namespace OpenVic;
+using namespace OpenVic::NodeTools;
+
+struct AlignedElement {
+public:
+ enum class format_t {
+ left, centre, right, justified
+ };
+
+private:
+ format_t PROPERTY(format);
+
+protected:
+ AlignedElement();
+
+ //bool _fill_key_map(NodeTools::case_insensitive_key_map_t& key_map, UIManager const& ui_manager) override;
+
+ bool _fill_key_map(case_insensitive_key_map_t& key_map) {
+ using enum format_t;
+ static const string_map_t<format_t> format_map = {
+ { "left", left }, { "right", right }, { "centre", centre }, { "center", centre }, { "justified", justified }
+ };
+ return add_key_map_entries(key_map,
+ "format", ZERO_OR_ONE, expect_identifier(expect_mapped_string(format_map, assign_variable_callback(format))
+ ));
+ }
+
+
+public:
+ AlignedElement(AlignedElement&&) = default;
+ virtual ~AlignedElement() = default;
+
+ //OV_DETAIL_GET_TYPE
+};