-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: クリーンアップの削除対象を強化 (まったく同じ設定のスキンパーツを消去対象に)
- Loading branch information
Showing
7 changed files
with
145 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace Pspkurara.UI.Skinner | ||
{ | ||
|
||
/// <summary> | ||
/// 配列系のいろいろをサポートするヘルパークラス | ||
/// </summary> | ||
internal static class ArrayHelper | ||
{ | ||
|
||
/// <summary> | ||
/// 一致チェック用メソッドデリゲート | ||
/// </summary> | ||
/// <typeparam name="T">要素の型</typeparam> | ||
/// <param name="a">1つ目の比較対象の要素</param> | ||
/// <param name="b">2つ目の比較対象の要素</param> | ||
/// <returns></returns> | ||
public delegate bool ElementComparer<T>(T a, T b); | ||
|
||
/// <summary> | ||
/// 配列の中身が一致しているかを調べる | ||
/// </summary> | ||
/// <typeparam name="T">配列の要素の型</typeparam> | ||
/// <param name="a">1つ目比較対象の配列</param> | ||
/// <param name="b">2つ目比較対象の配列</param> | ||
/// <param name="comparer">一致チェック用メソッド</param> | ||
/// <returns>一致する</returns> | ||
public static bool ArrayEquals<T>(IEnumerable<T> a, IEnumerable<T> b, ElementComparer<T> comparer) | ||
{ | ||
if (a == null && b == null) return true; | ||
if (a == null || b == null) return false; | ||
if (a.Count() != b.Count()) return false; | ||
for (int i = 0; i < a.Count(); i++) | ||
{ | ||
if (!comparer.Invoke(a.ElementAt(i), b.ElementAt(i))) return false; | ||
} | ||
return true; | ||
} | ||
|
||
/// <summary> | ||
/// <see cref="foreach"/>をまわす | ||
/// </summary> | ||
/// <param name="arraySize">配列サイズ</param> | ||
/// <param name="elementAction">呼び出すメソッド</param> | ||
public static void ForEach<T>(int arraySize, System.Action<int> elementAction) | ||
{ | ||
for (int i = 0; i < arraySize; i++) | ||
{ | ||
elementAction.Invoke(i); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// <see cref="foreach"/>をまわす | ||
/// </summary> | ||
/// <param name="array">配列</param> | ||
/// <param name="elementAction">呼び出すメソッド</param> | ||
public static void ForEach<T>(IEnumerable<T> array, System.Action<T> elementAction) | ||
{ | ||
if (array == null) return; | ||
for (int i = 0; i < array.Count(); i++) | ||
{ | ||
elementAction.Invoke(array.ElementAt(i)); | ||
} | ||
} | ||
|
||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters