2018-01-31 21:09:08 -06:00
|
|
|
using System;
|
2017-09-15 08:22:51 -07:00
|
|
|
using System.Collections.Generic;
|
2018-01-31 21:09:08 -06:00
|
|
|
using System.IO;
|
2017-09-15 08:22:51 -07:00
|
|
|
|
|
|
|
|
namespace ACE.DatLoader.Entity
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2018-08-10 19:56:25 -04:00
|
|
|
/// A list of indexed vertices, and their associated type
|
2017-09-15 08:22:51 -07:00
|
|
|
/// </summary>
|
2018-01-31 21:09:08 -06:00
|
|
|
public class CVertexArray : IUnpackable
|
2017-09-15 08:22:51 -07:00
|
|
|
{
|
2018-01-31 21:09:08 -06:00
|
|
|
public int VertexType { get; private set; }
|
|
|
|
|
public Dictionary<ushort, SWVertex> Vertices { get; } = new Dictionary<ushort, SWVertex>();
|
2017-09-15 08:22:51 -07:00
|
|
|
|
2018-01-31 21:09:08 -06:00
|
|
|
public void Unpack(BinaryReader reader)
|
2017-09-15 08:22:51 -07:00
|
|
|
{
|
2018-01-31 21:09:08 -06:00
|
|
|
VertexType = reader.ReadInt32();
|
2017-09-15 08:22:51 -07:00
|
|
|
|
2018-02-03 20:41:21 -06:00
|
|
|
var numVertices = reader.ReadUInt32();
|
2017-09-15 08:22:51 -07:00
|
|
|
|
2018-01-31 21:09:08 -06:00
|
|
|
if (VertexType == 1)
|
|
|
|
|
Vertices.Unpack(reader, numVertices);
|
|
|
|
|
else
|
|
|
|
|
throw new NotImplementedException();
|
2017-09-15 08:22:51 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|