Update parsers to use more real C data.
This commit is contained in:
@ -91,14 +91,17 @@ with open(headerFile, 'w') as f:
|
||||
def findProp(name, expectedType=''):
|
||||
for prop in properties.findall('property'):
|
||||
if prop.get('name') == name:
|
||||
if len(expectedType) > 0 and prop.get('type') != expectedType:
|
||||
continue
|
||||
if len(expectedType) > 0:
|
||||
if 'type' in prop.attrib and prop.get('type') != expectedType:
|
||||
continue
|
||||
if 'propertytype' in prop.attrib and prop.get('propertytype') != expectedType:
|
||||
continue
|
||||
return prop.get('value', '')
|
||||
return None
|
||||
|
||||
f.write(f" {{\n")
|
||||
|
||||
propSolid = findProp('solid', 'int')
|
||||
propSolid = findProp('solidType', 'tileSolidType')
|
||||
if propSolid is not None:
|
||||
f.write(f" .solidType = {propSolid},\n")
|
||||
|
||||
|
Reference in New Issue
Block a user