@@ -101,6 +101,14 @@ public Entity childOf(Entity parent) {
101101 return this .childOf (parent .id ());
102102 }
103103
104+ public Entity parent () {
105+ long parentId = this .target (FlecsConstants .EcsChildOf , 0 );
106+ if (parentId != 0 ) {
107+ return new Entity (this .world , parentId );
108+ }
109+ return null ;
110+ }
111+
104112 public Entity isA (long entityId ) {
105113 return this .addRelation (FlecsConstants .EcsIsA , entityId );
106114 }
@@ -110,6 +118,24 @@ public Entity removeRelation(long relation, long target) {
110118 return this .remove (pair );
111119 }
112120
121+ public boolean hasRelation (long relation , long target ) {
122+ long pair = flecs_h .ecs_make_pair (relation , target );
123+ return this .has (pair );
124+ }
125+
126+ public <T > T get (long relation , long target ) {
127+ long pair = flecs_h .ecs_make_pair (relation , target );
128+ return this .get (pair );
129+ }
130+
131+ public Entity removeRelation (long relation ) {
132+ return this .removeRelation (relation , FlecsConstants .EcsWildcard );
133+ }
134+
135+ public boolean hasRelation (long relation ) {
136+ return this .hasRelation (relation , FlecsConstants .EcsWildcard );
137+ }
138+
113139 @ SuppressWarnings ("unchecked" )
114140 public <T > Entity set (T data ) {
115141 Class <T > componentClass = (Class <T >) data .getClass ();
0 commit comments