Sic.Framework-Nanjing-Baishi/MECF.Framework.Common/Aitex/Core/Utilities/EnumLoop.cs

16 lines
284 B
C#
Raw Normal View History

2023-04-13 11:51:03 +08:00
using System;
namespace Aitex.Core.Utilities
{
public class EnumLoop<Key> where Key : struct, IConvertible
{
private static readonly Key[] arr = (Key[])Enum.GetValues(typeof(Key));
public static void ForEach(Action<Key> act)
{
foreach (var t in arr)
act(t);
}
}
}