Basic Entity hierarchy sync

This commit is contained in:
Simon Lübeß
2024-11-15 13:34:54 +01:00
parent d2efc6c5c4
commit 28c2922b89
15 changed files with 472 additions and 53 deletions
+5
View File
@@ -56,5 +56,10 @@ namespace GlitchyEngine.Core
return .Ok;
}
public static explicit operator uint64(UUID id)
{
return id._uuid;
}
}
}
+28 -4
View File
@@ -49,15 +49,39 @@ namespace GlitchyEngine
container.Clear();
}
public static mixin DeleteDictionaryAndReleaseValues(var container)
public static mixin DeleteDictionaryAndReleaseValues(var dictionary)
{
if (container != null)
if (dictionary != null)
{
for (var value in container)
for (var value in dictionary)
{
value.value?.ReleaseRef();
}
delete container;
delete dictionary;
}
}
public static mixin ClearDictionaryAndDisposeValues(var dictionary)
{
if (dictionary != null)
{
for (var value in dictionary)
{
value.value?.Dispose();
}
dictionary.Clear();
}
}
public static mixin DeleteDictionaryAndDisposeValues(var dictionary)
{
if (dictionary != null)
{
for (var value in dictionary)
{
value.value?.Dispose();
}
delete dictionary;
}
}
@@ -137,9 +137,9 @@ namespace GlitchyEngine.Renderer
if (slices.Length == 0)
return .Err;
if (slices.Length != 1)
if (nativeTexture != null && slices.Length != 1)
{
Runtime.NotImplemented("PlatformSetData(Span<TextureSliceData> slices) with more than 1 slice is not implemented yet.");
Runtime.NotImplemented("PlatformSetData(Span<TextureSliceData> slices) with more than 1 slice is not implemented for already created textures.");
}
if(nativeTexture == null)
+5
View File
@@ -1086,6 +1086,11 @@ namespace GlitchyEngine.World
handler(entity, componentType, component);
}
}
public WorldEnumerator GetEntities()
{
return _ecsWorld.Enumerate();
}
public WorldEnumerator<TComponent> GetEntities<TComponent>() where TComponent : struct
{