From 8e01f33d6b7b1c083222a1dab15250622c93022a Mon Sep 17 00:00:00 2001 From: Max G Date: Tue, 18 Jun 2019 15:49:41 -0500 Subject: [PATCH] Updated TypeId to be writable This makes the reader function a tiny bit cleaner. --- BinaryFormat/Chunks/PROP.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/BinaryFormat/Chunks/PROP.cs b/BinaryFormat/Chunks/PROP.cs index 0299827..9021c02 100644 --- a/BinaryFormat/Chunks/PROP.cs +++ b/BinaryFormat/Chunks/PROP.cs @@ -16,7 +16,11 @@ namespace RobloxFiles.BinaryFormat.Chunks public int TypeIndex { get; internal set; } public PropertyType Type { get; internal set; } - public byte TypeId => (byte)Type; + public byte TypeId + { + get { return (byte)Type; } + internal set { Type = (PropertyType)value; } + } public void LoadFromReader(BinaryRobloxFileReader reader) { @@ -24,9 +28,7 @@ namespace RobloxFiles.BinaryFormat.Chunks TypeIndex = reader.ReadInt32(); Name = reader.ReadString(); - - byte propType = reader.ReadByte(); - Type = (PropertyType)propType; + TypeId = reader.ReadByte(); INST type = file.Types[TypeIndex]; Property[] props = new Property[type.NumInstances];