2019-02-01 17:19:20 +00:00
|
|
|
|
namespace RobloxFiles.BinaryFormat.Chunks
|
2019-01-26 00:39:37 +00:00
|
|
|
|
{
|
|
|
|
|
public class INST
|
|
|
|
|
{
|
|
|
|
|
public readonly int TypeIndex;
|
|
|
|
|
public readonly string TypeName;
|
|
|
|
|
public readonly bool IsService;
|
|
|
|
|
public readonly int NumInstances;
|
|
|
|
|
public readonly int[] InstanceIds;
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return TypeName;
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-19 04:44:51 +00:00
|
|
|
|
public INST(BinaryRobloxFileChunk chunk)
|
2019-01-26 00:39:37 +00:00
|
|
|
|
{
|
2019-05-19 04:44:51 +00:00
|
|
|
|
using (BinaryRobloxFileReader reader = chunk.GetDataReader())
|
2019-01-26 00:39:37 +00:00
|
|
|
|
{
|
|
|
|
|
TypeIndex = reader.ReadInt32();
|
|
|
|
|
TypeName = reader.ReadString();
|
|
|
|
|
IsService = reader.ReadBoolean();
|
|
|
|
|
|
|
|
|
|
NumInstances = reader.ReadInt32();
|
|
|
|
|
InstanceIds = reader.ReadInstanceIds(NumInstances);
|
|
|
|
|
}
|
2019-01-29 09:50:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-01-30 06:36:56 +00:00
|
|
|
|
public void Allocate(BinaryRobloxFile file)
|
2019-01-29 09:50:55 +00:00
|
|
|
|
{
|
|
|
|
|
foreach (int instId in InstanceIds)
|
|
|
|
|
{
|
2019-05-19 04:44:51 +00:00
|
|
|
|
Instance inst = new Instance() { ClassName = TypeName };
|
2019-01-29 09:50:55 +00:00
|
|
|
|
file.Instances[instId] = inst;
|
|
|
|
|
}
|
2019-01-26 00:39:37 +00:00
|
|
|
|
|
2019-01-29 09:50:55 +00:00
|
|
|
|
file.Types[TypeIndex] = this;
|
2019-01-26 00:39:37 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|