Updated TypeId to be writable

This makes the reader function a tiny bit cleaner.
This commit is contained in:
Max G 2019-06-18 15:49:41 -05:00 committed by GitHub
parent 8821731aab
commit 8e01f33d6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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];