Add variables for int and float types#5
Conversation
leoetlino
left a comment
There was a problem hiding this comment.
(sorry for the long delay in reviewing this!)
| self.items = {} | ||
|
|
||
| def _do_read(self, stream: ReadStream) -> None: | ||
| sub_flow_event_indices_offset = stream.read_u64() |
There was a problem hiding this comment.
can we rename these variables to match the names in https://github.com/open-ead/EventFlow/blob/556793186c3065e7b25a51247d0560d7ff401b81/include/evfl/ResFlowchart.h#L71-L83 ?
|
|
||
| if x1a > 0: | ||
| with SeekContext(stream, x8): | ||
| dic = DicReader() |
| self.main_event: Index[evfl.event.Event] = Index() | ||
| self._sub_flow_event_indices: typing.List[int] = [] | ||
| self._sub_flow_event_indices_offset_writer: typing.Optional[PlaceholderWriter] = None | ||
| self.items = {} |
| import os | ||
|
|
||
|
|
||
| class Variable(BinaryObject): |
There was a problem hiding this comment.
VariableDef (to match the actual name in the EventFlow lib)
| kResFlowchartNotFound = 2 | ||
| kEntryPointNotFound = 3 | ||
|
|
||
| class VariableType(enum.IntEnum): |
There was a problem hiding this comment.
This is actually the same enum as ContainerDataType (aka ore::ResMetaData::DataType)
| self.type = stream.read_u16() | ||
| assert self.type == VariableType.kInteger or self.type == VariableType.kFloat | ||
| stream.seek(offset) | ||
| if self.type == VariableType.kInteger: |
There was a problem hiding this comment.
needs handling of int arrays and float arrays
There was a problem hiding this comment.
I don't have the means to look into the evfl library and how it handles VariableDefs, but how exactly do you imagine arrays to be handled here?
the data comes before the data_type in VariableDefs, so how would you know when to read the data_type?
the data seems to be always u64 (8 bytes), so either it is a pointer to arrays or arrays are not possible in VariableDefs. but since number of items is variable, I assume it is the former?
Can you confirm this? I know this it has been a few years, but I just wanted to ask about it regardless.
|
Could this be merged please? I am using event-editor daily, and would love for it to be improved! |
Addresses Issue #4