Обновить tpl/macro.twig

This commit is contained in:
Pavel Shevaev 2025-05-19 19:30:07 +03:00
parent 4596ff8076
commit 9a0a872209
1 changed files with 2 additions and 8 deletions

View File

@ -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 %}