aboutsummaryrefslogtreecommitdiff
path: root/codegen/lib/code
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-06-11 09:50:14 -0500
committermat <github@matdoes.dev>2022-06-11 09:50:14 -0500
commitb852bdc48150c0c01f341f73dfb84084b50eda9c (patch)
treeda2dfe72251908c87d0932d3bb85534f3b7859e8 /codegen/lib/code
parent6926907528135f7b6c891540b1aa2fdbe7696014 (diff)
downloadazalea-drasl-b852bdc48150c0c01f341f73dfb84084b50eda9c.tar.xz
Separate int properties
Diffstat (limited to 'codegen/lib/code')
-rw-r--r--codegen/lib/code/blocks.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/codegen/lib/code/blocks.py b/codegen/lib/code/blocks.py
index a5c9e2c6..d2fe6da2 100644
--- a/codegen/lib/code/blocks.py
+++ b/codegen/lib/code/blocks.py
@@ -1,7 +1,7 @@
+from lib.utils import upper_first_letter
from lib.utils import get_dir_location
from lib.utils import to_camel_case
from ..mappings import Mappings
-import json
BLOCKS_RS_DIR = get_dir_location('../azalea-block/src/blocks.rs')
@@ -25,7 +25,9 @@ def generate_blocks(blocks_burger: dict, blocks_report: dict, mappings: Mappings
if property_name:
break
assert property_name
- property_name = property_name.lower()
+ property_name = to_camel_case(property_name.lower())
+ if property['type'] == 'int':
+ property_name = to_camel_case(block_data_burger['text_id']) + property_name
return property_name
# Find properties
@@ -84,7 +86,7 @@ def generate_blocks(blocks_burger: dict, blocks_report: dict, mappings: Mappings
property_struct_name = get_property_struct_name(property, block_data_burger)
assert property_default is not None
new_make_block_states_macro_code.append(
- f' {to_camel_case(property_struct_name)}={to_camel_case(property_default)},')
+ f' {property_struct_name}={to_camel_case(property_default)},')
# new_make_block_states_macro_code.append(
# f' {to_camel_case(state)}=TODO,')
new_make_block_states_macro_code.append(' },')