#pragma once #include #include #include #include #include namespace fractal { constexpr size_t g_max_groups = 32; constexpr size_t g_max_weighted_groups = 32; constexpr size_t g_max_variables = 32; constexpr size_t g_max_concurrent_leafs = 1024; constexpr size_t g_max_rules_basic = 16; constexpr size_t g_max_rules_marking = 4; using token_id_t = uint32_t; using group_id_t = uint32_t; using weighted_group_id_t = uint32_t; enum class token_type_e { none, walk, rotate, generate, }; struct token_t { token_type_e m_token = token_type_e::none; mtl::fixed m_value; }; struct group_characteristic_t { static constexpr size_t g_max_group_size = 32; uint32_t m_factor; // Number of groups generated in succession etl::vector m_token_ids; }; struct marker_t { mtl::vec2 m_pos; uint32_t m_id; }; struct leaf_t { group_id_t m_group_id; mtl::vec2 m_position; mtl::mat<2, 2> m_orientation; }; struct weighted_leaf_t { weighted_group_id_t m_weighed_group_id; mtl::vec2 m_position; mtl::mat<2, 2> m_orientation; }; struct group_t { static constexpr size_t g_max_child_leafs = 16; static constexpr size_t g_max_child_markers = 8; etl::vector m_child_leafs; etl::vector m_child_markers; }; struct weighted_group_t { static constexpr size_t g_max_group_weights = 8; etl::vector m_groups; etl::vector m_weights; uint32_t m_weight_total; }; struct branch_rule_basic_t { token_id_t m_match; weighted_group_id_t m_weighted_group; }; struct branch_rule_marking_t { token_id_t m_match; uint32_t m_point_id; }; } // namespace fractal