FlixelGroup
View sourceclass
org.flixelgdx.group.FlixelGroup
Framework-agnostic member list backed by a SnapshotArray. Use this in a plain libGDX Screen or game loop with any member type (FlixelGroup<Actor>, FlixelGroup<YourEntity>, etc.): call FlixelGroup.add(T), FlixelGroup.remove(T), and FlixelGroup.forEachMember yourself; there is no automatic update/draw.
For gameplay objects that implement IFlixelBasic (including FlixelBasic subclasses), use FlixelBasicGroup or FlixelState instead so members receive the usual update/draw/recycle lifecycle.
See Also: FlixelBasicGroup
Constructors
FlixelGroup(ArraySupplier<T[]>)
Creates a new group with the given array factory and unlimited size by default.
Parameters:
| Name | Description |
|---|---|
arrayFactory | The array factory to use. |
FlixelGroup(ArraySupplier<T[]>, int)
Creates a new group with the given array factory and maximum size.
Parameters:
| Name | Description |
|---|---|
arrayFactory | The array factory to use. |
maxSize | The maximum size of the group. |
Fields
members
maxSize
Methods
ensureMembers()
add(T)
remove(T)
clear()
resetStorage()
Clears the member list and discards the backing SnapshotArray so the next FlixelGroup.ensureMembers() or FlixelGroup.add(T) allocates a fresh array. Does not call any method on member instances.