mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-18 01:44:35 +08:00
remove useless
This commit is contained in:
parent
2cbdb4f994
commit
431d501f27
@ -422,8 +422,6 @@ namespace DCFApixels.DragonECS
|
|||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public sealed class TypeMetaData
|
public sealed class TypeMetaData
|
||||||
{
|
{
|
||||||
@ -444,9 +442,6 @@ namespace DCFApixels.DragonECS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class TypeMetaDataCached
|
public class TypeMetaDataCached
|
||||||
{
|
{
|
||||||
internal readonly Type _type;
|
internal readonly Type _type;
|
||||||
@ -572,35 +567,3 @@ namespace DCFApixels.DragonECS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace DCFApixels.DragonECS.Internal
|
|
||||||
{
|
|
||||||
internal static class EcsTypeMeta
|
|
||||||
{
|
|
||||||
private static readonly Dictionary<Type, int> _codes = new Dictionary<Type, int>();
|
|
||||||
private static int _increment = 1;
|
|
||||||
public static int Count
|
|
||||||
{
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
||||||
get { return _codes.Count; }
|
|
||||||
}
|
|
||||||
public static int Get(Type type)
|
|
||||||
{
|
|
||||||
if (!_codes.TryGetValue(type, out int code))
|
|
||||||
{
|
|
||||||
code = _increment++;
|
|
||||||
_codes.Add(type, code);
|
|
||||||
}
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
||||||
public static int Get<T>() { return EcsTypeCodeCache<T>.code; }
|
|
||||||
public static bool Has(Type type) { return _codes.ContainsKey(type); }
|
|
||||||
public static bool Has<T>() { return _codes.ContainsKey(typeof(T)); }
|
|
||||||
}
|
|
||||||
internal static class EcsTypeMetaCache<T>
|
|
||||||
{
|
|
||||||
public static readonly int code = EcsTypeMeta.Get(typeof(T));
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user