Skip to content

Commit

Permalink
Update binary.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Captian-obvious authored Oct 23, 2023
1 parent 4c3b74e commit e8a189f
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions pyrbxm/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,18 +185,17 @@ class PROP:
Name: str = ""
ClassIndex: int = -1
Type: PropertyType = PropertyType.Unknown

@property
def Class(self):
return self.File.Classes[self.ClassIndex]

##end
@property
def ClassName(self):
return self.Class.ClassName if self.Class else "UnknownClass"

##end
def __str__(self):
return f"{self.Type} {self.ClassName}.{self.Name}"

##end
def deserialize(self, stream: BinaryStream, file: RobloxBinaryFile):
self.File = file
(self.ClassIndex,) = stream.unpack("<i")
Expand All @@ -210,19 +209,7 @@ def deserialize(self, stream: BinaryStream, file: RobloxBinaryFile):
), f"Unknown class index {self.ClassIndex} (@ {self})!"
ids = self.Class.InstanceIds
instCount = self.Class.NumInstances


"""
var
props = new
Property[instCount];
for (int i = 0; i < instCount; i++)
{
int
id = ids[i];
Instance
instance = File.Instances[id];
##end

if (instance == null)
{
Expand Down

0 comments on commit e8a189f

Please sign in to comment.