From 740d289ac84f7c27f6d2ee0eeda770ebfdbee9be Mon Sep 17 00:00:00 2001 From: copygirl Date: Fri, 11 Nov 2022 01:18:40 +0100 Subject: [PATCH] Additional flecs types --- src/gaemstone/Flecs/Core.cs | 12 ++++++++++++ src/gaemstone/Flecs/DeletionEvent.cs | 18 ++++++++++++++++++ src/gaemstone/Flecs/ObserverEvent.cs | 8 -------- 3 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 src/gaemstone/Flecs/DeletionEvent.cs diff --git a/src/gaemstone/Flecs/Core.cs b/src/gaemstone/Flecs/Core.cs index 39d6099..38c036a 100644 --- a/src/gaemstone/Flecs/Core.cs +++ b/src/gaemstone/Flecs/Core.cs @@ -6,18 +6,30 @@ namespace gaemstone.Flecs; public static class Core { // Entity Tags + [Tag] public struct Module { } [Tag] public struct Prefab { } [Tag] public struct SlotOf { } [Tag] public struct Disabled { } [Tag] public struct Empty { } + // Entities + + [Entity] public struct World { } + [Entity(Name = "*")] public struct Wildcard { } + [Entity(Name = "_")] public struct Any { } + [Entity] public struct This { } + [Entity(Name = "$")] public struct Variable { } + [Entity] public struct Flag { } + // Entity Relationships + [Tag, Relation] public struct IsA { } [Tag, Relation] public struct ChildOf { } [Tag, Relation] public struct DependsOn { } // Component / Relationship Properties + [Tag] public struct Transitive { } [Tag] public struct Reflexive { } [Tag] public struct Symmetric { } diff --git a/src/gaemstone/Flecs/DeletionEvent.cs b/src/gaemstone/Flecs/DeletionEvent.cs new file mode 100644 index 0000000..97927b1 --- /dev/null +++ b/src/gaemstone/Flecs/DeletionEvent.cs @@ -0,0 +1,18 @@ +using gaemstone.ECS; + +namespace gaemstone.Flecs; + +[Module("flecs", "core")] +public static class DeletionEvent +{ + [Tag, Relation] public struct OnDelete { } + [Tag, Relation] public struct OnDeleteTarget { } +} + +[Module("flecs", "core")] +public static class DeletionBehavior +{ + [Tag] public struct Remove { } + [Tag] public struct Delete { } + [Tag] public struct Panic { } +} diff --git a/src/gaemstone/Flecs/ObserverEvent.cs b/src/gaemstone/Flecs/ObserverEvent.cs index 941552c..2cfbb74 100644 --- a/src/gaemstone/Flecs/ObserverEvent.cs +++ b/src/gaemstone/Flecs/ObserverEvent.cs @@ -9,14 +9,6 @@ public static class ObserverEvent [Entity] public struct OnRemove { } [Entity] public struct OnSet { } [Entity] public struct UnSet { } - // [Entity] public struct OnDelete { } - // [Entity] public struct OnCreateTable { } - // [Entity] public struct OnDeleteTable { } [Entity] public struct OnTableEmpty { } [Entity] public struct OnTableFilled { } - // [Entity] public struct OnCreateTrigger { } - // [Entity] public struct OnDeleteTrigger { } - // [Entity] public struct OnDeleteObservable { } - // [Entity] public struct OnComponentHooks { } - // [Entity] public struct OnDeleteTarget { } }