mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-12 15:02:20 +00:00
Core - Add ResourcePackImporter.cs
This commit is contained in:
@@ -17,17 +17,22 @@ namespace PckStudio.Core.Extensions
|
||||
yield break;
|
||||
}
|
||||
|
||||
public static ImageList ToImageList(this Image[] images)
|
||||
public static ImageList ToImageList(this IEnumerable<Image> images)
|
||||
{
|
||||
ImageList imageList = new ImageList
|
||||
{
|
||||
ColorDepth = ColorDepth.Depth32Bit
|
||||
};
|
||||
imageList.Images.AddRange(images);
|
||||
imageList.Images.AddRange(images.ToArray());
|
||||
|
||||
return imageList;
|
||||
}
|
||||
|
||||
public static string ToString<T>(this IEnumerable<T> range, string seperator)
|
||||
=> range
|
||||
.Select(t => t.ToString())
|
||||
.Aggregate((res, next) => string.IsNullOrWhiteSpace(next) ? res : res + seperator + next);
|
||||
|
||||
public static bool EqualsAny<T>(this T type, params T[] items)
|
||||
{
|
||||
foreach (T item in items)
|
||||
@@ -38,14 +43,6 @@ namespace PckStudio.Core.Extensions
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool ContainsAny<T>(this IEnumerable<T> array, params T[] items)
|
||||
{
|
||||
foreach (T item in array)
|
||||
{
|
||||
if (items.Contains(item))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static bool ContainsAny<T>(this IEnumerable<T> source, params T[] items) => source.Any(t => items.Contains(t));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user