Skip to content

Commit d5f36eb

Browse files
committed
ObjectReader - type hint improvement
1 parent d160f38 commit d5f36eb

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

‎UnityPy/files/ObjectReader.py‎

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING, Generic, List, Optional, TypeVar, Union
3+
from typing import TYPE_CHECKING, Generic, List, Optional, Tuple, TypeVar, Union
44

55
from ..enums import ClassIDType
66
from ..exceptions import TypeTreeError
@@ -10,20 +10,31 @@
1010
from ..streams import EndianBinaryReader, EndianBinaryWriter
1111

1212
if TYPE_CHECKING:
13-
from ..files import SerializedFile
13+
from ..enums import BuildTarget
14+
from ..files.SerializedFile import BuildType, SerializedFile, SerializedType
1415

1516
T = TypeVar("T")
1617

1718

1819
class ObjectReader(Generic[T]):
20+
assets_file: SerializedFile
21+
reader: EndianBinaryReader
22+
data: bytes
23+
version: Tuple[int, int, int, int]
24+
version2: int
25+
platform: BuildTarget
26+
build_type: BuildType
27+
path_id: int
28+
byte_start_offset: Tuple[int, int]
1929
byte_start: int
30+
byte_size_offset: Tuple[int, int]
2031
byte_size: int
2132
type_id: int
33+
serialized_type: Optional[SerializedType]
2234
class_id: int
2335
type: ClassIDType
24-
path_id: int
25-
assets_file: SerializedFile
26-
_read_until: int
36+
is_destroyed: Optional[int]
37+
is_stripped: Optional[int]
2738

2839
# saves where the parser stopped
2940
# in case that not all data is read

0 commit comments

Comments
 (0)