Intentionally keep enums ints
https://gitlab.com/teeworlds-network/twnet_parser/-/issues/7
This commit is contained in:
parent
67c54c4be4
commit
1fd099c3de
|
@ -193,9 +193,11 @@ def gen_unpack_members(msg: NetMessageJson) -> str:
|
|||
else:
|
||||
unpacker = 'str()'
|
||||
elif arr_member['kind'] == 'enum':
|
||||
# TODO: can we represent the enum as text
|
||||
# instead of as magic number?
|
||||
unpacker = 'int() # TODO: this is a enum'
|
||||
# We intentionally do not do anything fancy here
|
||||
# no enums for example because it comes with too many
|
||||
# disadvantages see the related issue here
|
||||
# https://gitlab.com/teeworlds-network/twnet_parser/-/issues/7
|
||||
unpacker = 'int()'
|
||||
elif arr_member['kind'] == 'boolean':
|
||||
unpacker = 'int() == 1'
|
||||
elif arr_member['kind'] in ('int32', 'tick'):
|
||||
|
|
Loading…
Reference in a new issue