mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-28 08:45:50 +00:00
Core - Move InvalidDLCPackage class into DLCPackage.cs
This commit is contained in:
@@ -82,7 +82,7 @@ namespace PckStudio.Core.DLC
|
||||
DLCPackageType.MG01 => new DLCBattlePackage(name, identifier),
|
||||
DLCPackageType.MG02 => new DLCMiniGamePackage(name, identifier, packageType, MiniGameId.Tumble),
|
||||
DLCPackageType.MG03 => new DLCMiniGamePackage(name, identifier, packageType, MiniGameId.Glide),
|
||||
DLCPackageType.Invalid => InvalidDLCPackage.Instance,
|
||||
DLCPackageType.Invalid => DLCPackage.Invalid,
|
||||
_ => throw new ArgumentException("Unable to create DLC Package of 'Unknown' type."),
|
||||
};
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace PckStudio.Core.DLC
|
||||
throw new Exception($"{nameof(Platform)} is Unknown.");
|
||||
|
||||
if (!IsValidPckFile(fileInfo))
|
||||
return InvalidDLCPackage.Instance;
|
||||
return DLCPackage.Invalid;
|
||||
|
||||
using Stream stream = fileInfo.OpenRead();
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace PckStudio.Core.DLC
|
||||
{
|
||||
public abstract class DLCPackage : IDLCPackage
|
||||
{
|
||||
public static IDLCPackage Invalid = new InvalidDLCPackage();
|
||||
protected DLCPackage(string name, int identifier, IDLCPackage parentPackage)
|
||||
{
|
||||
Name = name;
|
||||
@@ -17,6 +18,13 @@ namespace PckStudio.Core.DLC
|
||||
ParentPackage = parentPackage;
|
||||
}
|
||||
|
||||
private sealed class InvalidDLCPackage : DLCPackage
|
||||
{
|
||||
internal InvalidDLCPackage() : base(nameof(InvalidDLCPackage), -1, null) { }
|
||||
|
||||
public override DLCPackageType GetDLCPackageType() => DLCPackageType.Invalid;
|
||||
}
|
||||
|
||||
public int Identifier { get; }
|
||||
|
||||
public string Name { get; } = string.Empty;
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using PckStudio.Core.Interfaces;
|
||||
|
||||
namespace PckStudio.Core.DLC
|
||||
{
|
||||
// Dummy class
|
||||
internal sealed class InvalidDLCPackage : DLCPackage
|
||||
{
|
||||
internal static IDLCPackage Instance { get; } = new InvalidDLCPackage();
|
||||
|
||||
private InvalidDLCPackage(string name, int identifier, IDLCPackage parentPackage)
|
||||
: base(name, identifier, parentPackage)
|
||||
{
|
||||
}
|
||||
|
||||
private InvalidDLCPackage()
|
||||
: this(nameof(InvalidDLCPackage), -1, null)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override DLCPackageType GetDLCPackageType() => DLCPackageType.Invalid;
|
||||
}
|
||||
}
|
||||
@@ -131,7 +131,6 @@
|
||||
<Compile Include="Interfaces\IPckAssetSerializer.cs" />
|
||||
<Compile Include="Interfaces\ISaveContext.cs" />
|
||||
<Compile Include="Interfaces\ITryGetSet.cs" />
|
||||
<Compile Include="DLC\InvalidDLCPackage.cs" />
|
||||
<Compile Include="IO\3DST\3DSTextureReader.cs" />
|
||||
<Compile Include="IO\3DST\3DSTextureWriter.cs" />
|
||||
<Compile Include="IO\3DST\TextureCodec.cs" />
|
||||
|
||||
Reference in New Issue
Block a user