Removed Ghost.ArcEntities project, it's replaced by Ghost.Entities

Added Playback to EntityCommandBuffer
Added JobSchedular to world
Added ISystem and SystemGroup
Updated packages
This commit is contained in:
2025-12-08 20:44:56 +09:00
parent f44208b502
commit 5e276b289d
30 changed files with 2974 additions and 1597 deletions

View File

@@ -30,9 +30,9 @@ public static class ComponentTypeID<T>
internal static class ComponentRegister
{
private static int s_nextComponentTypeID = 0;
private static readonly Dictionary<IntPtr, Identifier<IComponent>> s_typeHandleToID = new();
private static readonly List<ComponentInfo> s_registeredComponents = new();
private static readonly Dictionary<IntPtr, Identifier<IComponent>> s_typeHandleToID = new();
private static readonly Dictionary<string, Identifier<IComponent>> s_nameToRuntimeID = new();
public static unsafe Identifier<IComponent> GetOrRegisterComponent<T>()
@@ -71,12 +71,26 @@ internal static class ComponentRegister
}
}
public static Identifier<IComponent> GetComponentID(Type type)
{
var typeHandle = type.TypeHandle.Value;
lock (s_registeredComponents)
{
if (s_typeHandleToID.TryGetValue(typeHandle, out var existingID))
{
return existingID;
}
}
throw new KeyNotFoundException($"Component type {type} is not registered.");
}
public static ComponentInfo GetComponentInfo(Identifier<IComponent> typeId)
{
return s_registeredComponents[typeId];
}
public static int GetHashCode(ReadOnlySpan<Identifier<IComponent>> componentTypeIDs)
public static int GetHashCode(params ReadOnlySpan<Identifier<IComponent>> componentTypeIDs)
{
var largestID = 0;
foreach (var id in componentTypeIDs)