mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-22 01:06:35 +00:00
PckFileDataExtensions - Rename 'Get<T>' to 'GetDeserializedData'/'GetData' respectively
This commit is contained in:
@@ -28,18 +28,18 @@ namespace PckStudio.Extensions
|
||||
{
|
||||
throw new Exception("File is not suitable to contain image data.");
|
||||
}
|
||||
return file.Get(ImageDeserializer.DefaultDeserializer);
|
||||
return file.GetDeserializedData(ImageDeserializer.DefaultDeserializer);
|
||||
}
|
||||
|
||||
internal static T Get<T>(this PckFileData file, IPckDeserializer<T> deserializer)
|
||||
internal static T GetDeserializedData<T>(this PckFileData file, IPckDeserializer<T> deserializer)
|
||||
{
|
||||
return deserializer.Deserialize(file);
|
||||
}
|
||||
|
||||
internal static T Get<T>(this PckFileData file, IDataFormatReader<T> deserializer) where T : class
|
||||
internal static T GetData<T>(this PckFileData file, IDataFormatReader<T> formatReader) where T : class
|
||||
{
|
||||
using var ms = new MemoryStream(file.Data);
|
||||
return deserializer.FromStream(ms);
|
||||
return formatReader.FromStream(ms);
|
||||
}
|
||||
|
||||
internal static void SetData<T>(this PckFileData file, T obj, IPckFileSerializer<T> serializer)
|
||||
|
||||
@@ -254,7 +254,7 @@ namespace PckStudio.Forms.Editor
|
||||
hasAnimation &&
|
||||
animationFile.Size > 0)
|
||||
{
|
||||
var animation = animationFile.Get(AnimationDeserializer.DefaultDeserializer);
|
||||
var animation = animationFile.GetDeserializedData(AnimationDeserializer.DefaultDeserializer);
|
||||
selectTilePictureBox.Start(animation);
|
||||
}
|
||||
}
|
||||
@@ -538,7 +538,7 @@ namespace PckStudio.Forms.Editor
|
||||
PckFileType.TextureFile
|
||||
);
|
||||
|
||||
var animation = file.Get(AnimationDeserializer.DefaultDeserializer);
|
||||
var animation = file.GetDeserializedData(AnimationDeserializer.DefaultDeserializer);
|
||||
|
||||
var animationEditor = new AnimationEditor(animation, _selectedTile.Tile.InternalName, GetBlendColor());
|
||||
if (animationEditor.ShowDialog(this) != DialogResult.OK)
|
||||
|
||||
@@ -519,7 +519,7 @@ namespace PckStudio
|
||||
!file.Filename.StartsWith(ResourceLocation.GetPathFromCategory(ResourceCategory.BlockAnimation)))
|
||||
return;
|
||||
|
||||
Animation animation = file.Get(AnimationDeserializer.DefaultDeserializer);
|
||||
Animation animation = file.GetDeserializedData(AnimationDeserializer.DefaultDeserializer);
|
||||
string filename = Path.GetFileNameWithoutExtension(file.Filename);
|
||||
|
||||
var textureInfos = ResourceLocation.GetCategoryFromPath(file.Filename) switch
|
||||
@@ -563,7 +563,7 @@ namespace PckStudio
|
||||
_ => GameRuleFile.CompressionType.Unknown
|
||||
};
|
||||
|
||||
GameRuleFile grf = file.Get(new GameRuleFileReader(compressiontype));
|
||||
GameRuleFile grf = file.GetData(new GameRuleFileReader(compressiontype));
|
||||
|
||||
using GameRuleFileEditor grfEditor = new GameRuleFileEditor(grf);
|
||||
if (grfEditor.ShowDialog(this) == DialogResult.OK)
|
||||
@@ -2442,7 +2442,7 @@ namespace PckStudio
|
||||
{
|
||||
try
|
||||
{
|
||||
ModelContainer container = file.Get(new ModelFileReader());
|
||||
ModelContainer container = file.GetData(new ModelFileReader());
|
||||
|
||||
if (container.Version == version)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user