42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
using LibW4M.Data.WeaponFactory;
|
|
using LibXom.Data;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace LibW4M.Data.Schemes
|
|
{
|
|
public class SchemesCollective : SaveDataCollective
|
|
{
|
|
public SchemesCollective(W4SaveFile fileBelongs, XomContainer mainContainer) : base(fileBelongs, mainContainer)
|
|
{
|
|
}
|
|
|
|
public override void Load()
|
|
{
|
|
int[] collective = mainContainer.Decompress();
|
|
for (int i = 0; i < collective[0]; i++)
|
|
{
|
|
SchemeData scheme = new SchemeData(this.fileBelongs, this.fileBelongs.xomFile.GetContainerById(collective[i + 1]));
|
|
base.collectiveEntries.Add(scheme);
|
|
}
|
|
}
|
|
|
|
public override void Save()
|
|
{
|
|
int len = this.Length;
|
|
int[] collective = new int[len + 1];
|
|
collective[0] = len;
|
|
for (int i = 0; i < len; i++)
|
|
{
|
|
SchemeData scheme = collectiveEntries[i] as SchemeData;
|
|
scheme.Save();
|
|
collective[i + 1] = scheme.mainContainer.Id;
|
|
}
|
|
mainContainer.CompressAndUpdate(collective);
|
|
}
|
|
}
|
|
}
|