I have added ability to relate entities by some relationship type + data.
import ecs "moecs/src" Joint :: struct { type : u8, data : [16]f32 } /* Related event callback. Relation of `type` is set from `entity` to `target` using `relation` data. */ related :: proc(world: ^ecs.World, entity: ^ecs.Entity, event: ecs.Event, type: typeid, target: rawptr, relation: rawptr) { switch type { case ecs.ChildOf: fmt.printfln("Related: %v, %v", type, (cast(^ecs.ChildOf)relation)^) case ecs.ParentOf: fmt.printfln("Related: %v, %v", type, (cast(^ecs.ParentOf)relation)^) case Joint: fmt.printfln("Related: %v, %v", type, (cast(^Joint)relation)^) } } main :: proc() { arr := [3]int{ 3, 7, 14 } ecs.init() world := ecs.new_world() /* ...register tags and components types here. */ /* You have to register relation type. */ ecs.register(world, .RELATION, Joint) ecs.run(world) /* You can qu