From 9a0a872209a93ae12a074f349cb30931896be914 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Mon, 19 May 2025 19:30:07 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20tpl/macro.twig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tpl/macro.twig | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tpl/macro.twig b/tpl/macro.twig index 999e0e6..e615a50 100644 --- a/tpl/macro.twig +++ b/tpl/macro.twig @@ -1,4 +1,3 @@ - {% macro decl_units(meta) %} {%- for u in meta.getunits ~%} @@ -274,17 +273,10 @@ array_merge(parent::CLASS_FIELDS_PROPS(), class {{o.name}} { - const CLASS_ID = {{o.classid}}; - {{ _self.enum_values(o) }} const DEFAULT_VALUE = {{o.values|length > 0 ? o.values | first : 0}}; - function getClassId() - { - return self::CLASS_ID; - } - static function isValueValid($value) { $values_list = self::getValuesList(); @@ -396,7 +388,9 @@ class {{o.name}} {% macro class_map(meta) %} {%- for u in meta.getunits ~%} +{%- if u.object is instanceof('\\mtgMetaStruct') -%} case {{u.object.classid}} : return "{{u.object.name}}"; +{%- endif ~%} {%- endfor ~%} {% endmacro %}