2018-07-03 06:59:56 -07:00
|
|
|
using ACE.DatLoader.FileTypes;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
2019-09-24 11:53:56 -05:00
|
|
|
using System.Linq;
|
2018-07-03 06:59:56 -07:00
|
|
|
|
|
|
|
|
namespace ACE.DatLoader.Entity
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public class SpellSet : IUnpackable
|
|
|
|
|
{
|
2019-03-18 22:50:00 -04:00
|
|
|
// uint key is the total combined item level of all the equipped pieces in the set
|
|
|
|
|
// client calls this m_PieceCount
|
|
|
|
|
public SortedDictionary<uint, SpellSetTiers> SpellSetTiers = new SortedDictionary<uint, SpellSetTiers>();
|
2018-07-03 06:59:56 -07:00
|
|
|
|
2019-09-24 11:53:56 -05:00
|
|
|
public uint HighestTier = 0;
|
|
|
|
|
|
|
|
|
|
public SortedDictionary<uint, SpellSetTiers> SpellSetTiersNoGaps = new SortedDictionary<uint, SpellSetTiers>();
|
|
|
|
|
|
2018-07-03 06:59:56 -07:00
|
|
|
public void Unpack(BinaryReader reader)
|
|
|
|
|
{
|
|
|
|
|
SpellSetTiers.UnpackPackedHashTable(reader);
|
2019-09-24 11:53:56 -05:00
|
|
|
|
|
|
|
|
HighestTier = SpellSetTiers.Keys.LastOrDefault();
|
|
|
|
|
|
|
|
|
|
SpellSetTiers lastSpellSetTier = null;
|
|
|
|
|
|
|
|
|
|
for (uint i = 0; i <= HighestTier; i++)
|
|
|
|
|
{
|
|
|
|
|
if (SpellSetTiers.TryGetValue(i, out var spellSetTiers))
|
|
|
|
|
lastSpellSetTier = spellSetTiers;
|
|
|
|
|
|
|
|
|
|
if (lastSpellSetTier != null)
|
|
|
|
|
SpellSetTiersNoGaps.Add(i, lastSpellSetTier);
|
|
|
|
|
}
|
2018-07-03 06:59:56 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|