mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-07-08 06:08:06 +00:00
EnumerableExtensions - Added EqualsAny extension
This commit is contained in:
@@ -15,6 +15,16 @@ namespace PckStudio.Extensions
|
||||
yield break;
|
||||
}
|
||||
|
||||
public static bool EqualsAny<T>(this T type, params T[] items)
|
||||
{
|
||||
foreach (var item in items)
|
||||
{
|
||||
if (item.Equals(type))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool ContainsAny<T>(this IEnumerable<T> array, params T[] items)
|
||||
{
|
||||
foreach (var item in array)
|
||||
|
||||
@@ -43,9 +43,11 @@ namespace PckStudio.Forms.Editor
|
||||
|
||||
private string _tileName = string.Empty;
|
||||
|
||||
private bool IsSpecialTile(string tileName)
|
||||
private static readonly string[] specialTileNames = { "clock", "compass" };
|
||||
|
||||
private static bool IsSpecialTile(string name)
|
||||
{
|
||||
return tileName == "clock" || tileName == "compass";
|
||||
return name.ToLower().EqualsAny(specialTileNames);
|
||||
}
|
||||
|
||||
private AnimationEditor()
|
||||
|
||||
Reference in New Issue
Block a user