mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-18 14:41:53 +00:00
Add SkinModel & SkinIdentifier class
This commit is contained in:
23
PCK-Studio/Internal/Skin/SkinIdentifier.cs
Normal file
23
PCK-Studio/Internal/Skin/SkinIdentifier.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace PckStudio.Internal.Skin
|
||||
{
|
||||
public sealed class SkinIdentifier : IFormattable
|
||||
{
|
||||
public int Id { get; }
|
||||
|
||||
public SkinIdentifier(int id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public static implicit operator int(SkinIdentifier _this) => _this.Id;
|
||||
|
||||
public string ToString(string format, IFormatProvider formatProvider) => Id.ToString(format, formatProvider);
|
||||
|
||||
public string ToString(string format) => Id.ToString(format, NumberFormatInfo.CurrentInfo);
|
||||
|
||||
public override string ToString() => Id.ToString(NumberFormatInfo.CurrentInfo);
|
||||
}
|
||||
}
|
||||
27
PCK-Studio/Internal/Skin/SkinModel.cs
Normal file
27
PCK-Studio/Internal/Skin/SkinModel.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using OMI.Formats.Pck;
|
||||
|
||||
namespace PckStudio.Internal.Skin
|
||||
{
|
||||
public sealed class SkinModel
|
||||
{
|
||||
public readonly List<SkinBOX> AdditionalBoxes;
|
||||
public readonly List<SkinPartOffset> PartOffsets;
|
||||
|
||||
public SkinModel()
|
||||
{
|
||||
AdditionalBoxes = new List<SkinBOX>();
|
||||
PartOffsets = new List<SkinPartOffset>(5);
|
||||
}
|
||||
|
||||
public SkinModel(IEnumerable<SkinBOX> additionalBoxes, IEnumerable<SkinPartOffset> partOffsets)
|
||||
{
|
||||
AdditionalBoxes = new List<SkinBOX>(additionalBoxes);
|
||||
PartOffsets = new List<SkinPartOffset>(partOffsets);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -198,7 +198,9 @@
|
||||
<Compile Include="Internal\App\CommitInfo.cs" />
|
||||
<Compile Include="External\Format\BlockBenchModel.cs" />
|
||||
<Compile Include="Internal\Skin\Skin.cs" />
|
||||
<Compile Include="Internal\Skin\SkinIdentifier.cs" />
|
||||
<Compile Include="Internal\Skin\SkinMetaData.cs" />
|
||||
<Compile Include="Internal\Skin\SkinModel.cs" />
|
||||
<Compile Include="Internal\Skin\SkinModelInfo.cs" />
|
||||
<Compile Include="Internal\Skin\SkinPartOffset.cs" />
|
||||
<Compile Include="Internal\ResourceLocation.cs" />
|
||||
|
||||
Reference in New Issue
Block a user