Skip to content

Commit 8a3cc30

Browse files
committed
feat(sdk): include getParent() in Entity
1 parent 037a8b2 commit 8a3cc30

File tree

1 file changed

+7
-0
lines changed
  • engine/modules/entities/src/main/java/com/codingame/gameengine/module/entities

1 file changed

+7
-0
lines changed

engine/modules/entities/src/main/java/com/codingame/gameengine/module/entities/Entity.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,4 +516,11 @@ protected static void requireValidColor(int color) {
516516
throw new IllegalArgumentException(color + "is not a valid RGB integer.");
517517
}
518518
}
519+
520+
/**
521+
* @return the Group or BufferedGroup which contains this entity
522+
*/
523+
public Optional<ContainerBasedEntity<?>> getParent() {
524+
return Optional.ofNullable(parent);
525+
}
519526
}

0 commit comments

Comments
 (0)