2017-08-18 05:22:44 -07:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2018-01-27 19:39:07 -06:00
|
|
|
using System.IO;
|
|
|
|
|
|
2017-08-18 05:22:44 -07:00
|
|
|
namespace ACE.DatLoader.Entity
|
|
|
|
|
{
|
2018-01-27 19:39:07 -06:00
|
|
|
public class AnimationFrame : IUnpackable
|
2017-08-18 05:22:44 -07:00
|
|
|
{
|
2018-02-03 20:41:21 -06:00
|
|
|
public List<Frame> Frames { get; } = new List<Frame>();
|
2018-01-27 19:39:07 -06:00
|
|
|
public List<AnimationHook> Hooks { get; } = new List<AnimationHook>();
|
2017-08-18 05:22:44 -07:00
|
|
|
|
2018-01-27 19:39:07 -06:00
|
|
|
/// <summary>
|
|
|
|
|
/// You must use the Unpack(BinaryReader reader, int numParts) method.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <exception cref="NotSupportedException">You must use the Unpack(BinaryReader reader, int numParts) method.</exception>
|
|
|
|
|
public void Unpack(BinaryReader reader)
|
2017-08-18 05:22:44 -07:00
|
|
|
{
|
2018-01-27 19:39:07 -06:00
|
|
|
throw new NotSupportedException();
|
|
|
|
|
}
|
2017-08-18 05:22:44 -07:00
|
|
|
|
2018-01-27 19:39:07 -06:00
|
|
|
public void Unpack(BinaryReader reader, uint numParts)
|
|
|
|
|
{
|
2018-02-03 20:41:21 -06:00
|
|
|
Frames.Unpack(reader, numParts);
|
2017-08-18 05:22:44 -07:00
|
|
|
|
2018-01-27 19:39:07 -06:00
|
|
|
uint numHooks = reader.ReadUInt32();
|
2017-08-18 05:22:44 -07:00
|
|
|
for (uint i = 0; i < numHooks; i++)
|
|
|
|
|
{
|
2018-01-27 19:39:07 -06:00
|
|
|
var hook = AnimationHook.ReadHook(reader);
|
|
|
|
|
Hooks.Add(hook);
|
2017-08-18 05:22:44 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|