mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-22 18:55:37 +00:00
25 lines
742 B
C#
25 lines
742 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using OMI.Formats.Pck;
|
|
using PckStudio.Core.Extensions;
|
|
using PckStudio.Interfaces;
|
|
|
|
namespace PckStudio.Core.Deserializer
|
|
{
|
|
public sealed class AtlasDeserializer : IPckAssetDeserializer<Atlas>
|
|
{
|
|
private readonly AtlasResource _resourceLocation;
|
|
|
|
public AtlasDeserializer(ResourceLocation resourceLocation)
|
|
{
|
|
_resourceLocation = resourceLocation as AtlasResource ?? throw new InvalidDataException(nameof(resourceLocation));
|
|
}
|
|
|
|
public Atlas Deserialize(PckAsset asset) => Atlas.FromResourceLocation(asset.GetTexture(), _resourceLocation);
|
|
}
|
|
}
|