MCPcopy Create free account
hub / github.com/defold/defold / gen_const_var

Function gen_const_var

engine/jni/scripts/gen_java.py:418–424  ·  view source on GitHub ↗
(decl, prefix)

Source from the content-addressed store, hash-verified

416 l(f"pub const {util.as_lower_snake_case(item_name, prefix)} = {item['value']};")
417
418def gen_const_var(decl, prefix):
419 item_name = check_override(decl['name'])
420 field_type = check_override(f'{prefix}.{item_name}', default=decl['type'])
421 suffix = ''
422 if field_type == 'float':
423 suffix = 'f'
424 l(f" public static final {field_type} {item_name} = {decl['value']}{suffix};")
425
426def gen_enum(decl, prefix):
427 enum_name = check_override(decl['name'])

Callers 1

gen_namespaceFunction · 0.85

Calls 2

check_overrideFunction · 0.85
lFunction · 0.70

Tested by

no test coverage detected