FlixelGroupable
View sourceinterface
org.flixelgdx.group.FlixelGroupable
Group-like containers with a typed member list. This interface is intentionally generic so libGDX projects can use FlixelGroup with any member type without adopting FlixelBasic.
FlixelGDX gameplay code that uses lifecycle flags and FlixelBasic.destroy() should implement FlixelBasicGroupable instead (or use FlixelBasicGroup / FlixelSpriteGroup).
Methods
add(T)
Adds a member to this group.
remove(T)
Removes the member from this group only. Does not interpret or tear down the member; see FlixelBasicGroupable for optional destroy semantics on FlixelBasic members.
clear()
Removes all members from the group without touching member instances.
getMembers()
Returns the backing array, or null if the implementation has not allocated it yet (FlixelGroup).
getMaxSize()
Returns the maximum number of members allowed. When 0, the group can grow without limit.
setMaxSize(int)
Sets the maximum number of members allowed. Values less than 0 are clamped to 0 (unlimited).
detach(T)
Removes the member from the group without additional teardown.
Parameters:
| Name | Description |
|---|---|
member | The member to remove. |
getFirstNullIndex()
Index of the first null slot in FlixelGroupable.getMembers(), or -1 if none.
forEachMember(Consumer<T>)
Invokes callback for each non-null member using snapshot iteration.
Parameters:
| Name | Description |
|---|---|
callback | The callback to call for each member. |
forEachMemberType(Class<C>, Consumer<C>)
Invokes callback for each member assignable to type.
Parameters:
| Name | Description |
|---|---|
type | The type to check. |
callback | The callback. |