Skip to content

Commit

Permalink
File - typeint improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
K0lb3 committed Sep 21, 2024
1 parent 9f1ff4f commit 449d405
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions UnityPy/files/File.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
from ..enums import FileType
from ..helpers import ImportHelper
from ..streams import EndianBinaryReader, EndianBinaryWriter
from __future__ import annotations

from collections import namedtuple
from os.path import basename
from typing import TYPE_CHECKING, Dict, Optional

from ..helpers import ImportHelper
from ..streams import EndianBinaryReader, EndianBinaryWriter

if TYPE_CHECKING:
from ..environment import Environment

DirectoryInfo = namedtuple("DirectoryInfo", "path offset size")


class File(object):
name: str
files: dict
environment: "Environment"
files: Dict[str, File]
environment: Environment
cab_file: str
is_changed: bool
signature: str
packer: str
is_dependency: bool

# parent: File
# environment: Environment

def __init__(self, parent=None, name: str = None, is_dependency: bool = False):
parent: Optional[File]

def __init__(
self,
parent: Optional[File] = None,
name: Optional[str] = None,
is_dependency: bool = False,
):
self.files = {}
self.is_changed = False
self.cab_file = "CAB-UnityPy_Mod.resS"
Expand Down Expand Up @@ -154,4 +162,4 @@ def mark_changed(self):


# recursive import requires the import down here
from . import BundleFile, SerializedFile, WebFile, ObjectReader
from . import BundleFile, ObjectReader, SerializedFile, WebFile

0 comments on commit 449d405

Please sign in to comment.