battle, ship boom boom

This commit is contained in:
rfi
2024-02-26 11:03:56 +07:00
parent 3046a7d20e
commit a6f4897c29
8 changed files with 424 additions and 4 deletions

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLHX.Server.Common.Utils
{
public static class TypeExtensions
{
static readonly HashSet<Type> numericTypes =
[
typeof(byte),
typeof(sbyte),
typeof(short),
typeof(ushort),
typeof(int),
typeof(uint),
typeof(float),
typeof(long),
typeof(ulong),
typeof(decimal)
];
public static bool IsTypeNumeric(this Type type)
{
return numericTypes.Contains(type);
}
}
}