1
0
mirror of https://github.com/ncblakely/GiantsTools synced 2024-12-05 02:53:08 +01:00
GiantsTools/Giants.EffectCompiler/FxBinaryData.cs

34 lines
854 B
C#
Raw Normal View History

namespace Giants.EffectCompiler
{
using System;
using System.IO;
public class FxBinaryData
{
public const int CurrentVersion = 2;
public int Version { get; private set; }
public int DataSize { get; private set; }
public int EffectCount { get; private set; }
public byte[] Data { get; private set; }
public FxBinaryData(Stream stream)
{
using var reader = new BinaryReader(stream);
this.Version = reader.ReadInt32();
if (this.Version != CurrentVersion)
{
throw new ArgumentException("The version number is incorrect.");
}
this.DataSize = reader.ReadInt32();
this.EffectCount = reader.ReadInt32();
this.Data = reader.ReadBytes(this.DataSize);
}
}
}