ace/Source/ACE.DatLoader/Entity/AnimationFrame.cs
Mag-nus 6f446c38fc
ACE.DatLoader More IUnpackable progress (#615)
* ACE.DatLoader.Tests fix for Animation.

Also includes some ACE.Entity.Position replacements with ACE.DatLoader.Entity.Frame

* ACE.DatLoader Scene converted

Also made all the ReadFromDat code more generic/copyable

* ACE.DatLoader Palette converted

* ACE.DatLoader: PaletteSet converted

* ACE.DatLoader: CombatManeuverTable converted

* ACE.DatLoader PhysicsScriptTable converted

* ACE.DatLoader SpellComponentTable converted

* ACE.DatLoader misc cleanups

* ACE.DatLoader Surface converted

* ACE.DatLoader much more progress
2018-02-03 20:41:21 -06:00

33 lines
1,020 B
C#

using System;
using System.Collections.Generic;
using System.IO;
namespace ACE.DatLoader.Entity
{
public class AnimationFrame : IUnpackable
{
public List<Frame> Frames { get; } = new List<Frame>();
public List<AnimationHook> Hooks { get; } = new List<AnimationHook>();
/// <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)
{
throw new NotSupportedException();
}
public void Unpack(BinaryReader reader, uint numParts)
{
Frames.Unpack(reader, numParts);
uint numHooks = reader.ReadUInt32();
for (uint i = 0; i < numHooks; i++)
{
var hook = AnimationHook.ReadHook(reader);
Hooks.Add(hook);
}
}
}
}