mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Ecs changes
- BitArray has always at least sizeof(uint) bits - Renamed Entity to EcsEntity - Added value parameter to EcsWorld.AssignComponent - Matched EcsWorld generic parameters - Added Scene - Added Entity
This commit is contained in:
@@ -26,7 +26,7 @@ namespace GlitchyEditor.EditWindows
|
||||
|
||||
if(_editor.SelectedEntities.Count == 1)
|
||||
{
|
||||
Entity entity = _editor.SelectedEntities.Front;
|
||||
EcsEntity entity = _editor.SelectedEntities.Front;
|
||||
|
||||
ShowComponents(entity);
|
||||
}
|
||||
@@ -34,7 +34,7 @@ namespace GlitchyEditor.EditWindows
|
||||
ImGui.End();
|
||||
}
|
||||
|
||||
private void ShowComponents(Entity entity)
|
||||
private void ShowComponents(EcsEntity entity)
|
||||
{
|
||||
NameComponentEditor.Show(_editor.World, entity);
|
||||
TransformComponentEditor.Show(_editor.World, entity);
|
||||
@@ -43,7 +43,7 @@ namespace GlitchyEditor.EditWindows
|
||||
|
||||
static class NameComponentEditor
|
||||
{
|
||||
public static void Show(EcsWorld world, Entity entity)
|
||||
public static void Show(EcsWorld world, EcsEntity entity)
|
||||
{
|
||||
char8[128] nameBuffer = default;
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace GlitchyEditor.EditWindows
|
||||
|
||||
static class TransformComponentEditor
|
||||
{
|
||||
public static void Show(EcsWorld world, Entity entity)
|
||||
public static void Show(EcsWorld world, EcsEntity entity)
|
||||
{
|
||||
TransformComponent* component = world.GetComponent<TransformComponent>(entity);
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace GlitchyEditor.EditWindows
|
||||
}
|
||||
}
|
||||
|
||||
private void ImGuiPrintEntityTree(TreeNode<Entity> tree)
|
||||
private void ImGuiPrintEntityTree(TreeNode<EcsEntity> tree)
|
||||
{
|
||||
String name = null;
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace GlitchyEditor.EditWindows
|
||||
|
||||
if(ImGui.BeginDragDropSource())
|
||||
{
|
||||
ImGui.SetDragDropPayload("DND_Entity", &tree.Value, sizeof(Entity));
|
||||
ImGui.SetDragDropPayload("DND_Entity", &tree.Value, sizeof(EcsEntity));
|
||||
|
||||
ImGui.Text(name);
|
||||
|
||||
@@ -153,13 +153,13 @@ namespace GlitchyEditor.EditWindows
|
||||
|
||||
if(payload != null)
|
||||
{
|
||||
Log.ClientLogger.AssertDebug(payload.DataSize == sizeof(Entity));
|
||||
Log.ClientLogger.AssertDebug(payload.DataSize == sizeof(EcsEntity));
|
||||
|
||||
Entity movedEntity = *(Entity*)payload.Data;
|
||||
EcsEntity movedEntity = *(EcsEntity*)payload.Data;
|
||||
|
||||
bool dropLegal = true;
|
||||
|
||||
Entity walker = tree.Value;
|
||||
EcsEntity walker = tree.Value;
|
||||
|
||||
// make sure the dropped entity is not a parent of the entity we dropped it on.
|
||||
while(true)
|
||||
@@ -230,9 +230,9 @@ namespace GlitchyEditor.EditWindows
|
||||
{
|
||||
// Show entity hierarchy as tree
|
||||
|
||||
TreeNode<Entity> root = scope .(.InvalidEntity);
|
||||
TreeNode<EcsEntity> root = scope .(.InvalidEntity);
|
||||
|
||||
TreeNode<Entity> AddEntity(Entity entity)
|
||||
TreeNode<EcsEntity> AddEntity(EcsEntity entity)
|
||||
{
|
||||
var parent = _editor.World.GetComponent<ParentComponent>(entity);
|
||||
|
||||
@@ -264,9 +264,9 @@ namespace GlitchyEditor.EditWindows
|
||||
|
||||
if(payload != null)
|
||||
{
|
||||
Log.ClientLogger.AssertDebug(payload.DataSize == sizeof(Entity));
|
||||
Log.ClientLogger.AssertDebug(payload.DataSize == sizeof(EcsEntity));
|
||||
|
||||
Entity movedEntity = *(Entity*)payload.Data;
|
||||
EcsEntity movedEntity = *(EcsEntity*)payload.Data;
|
||||
|
||||
_editor.World.RemoveComponent<ParentComponent>(movedEntity);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user