Package mindustry.entities
Class EntityGroup<T extends mindustry.gen.Entityc>
java.lang.Object
mindustry.entities.EntityGroup<T>
- All Implemented Interfaces:
Iterable<T>
Represents a group of a certain type of entity.
-
Constructor Summary
ConstructorDescriptionEntityGroup
(Class<T> type, boolean spatial, boolean mapping) EntityGroup
(Class<T> type, boolean spatial, boolean mapping, EntityIndexer indexer) -
Method Summary
Modifier and TypeMethodDescriptionvoid
int
static void
checkNextId
(int id) Makes sure the next ID counter is higher than this number, so future entities cannot possibly use this ID.void
clear()
void
collide()
boolean
copy()
int
void
void
void
first()
getByID
(int id) index
(int i) intersect
(float x, float y, float width, float height) void
boolean
isEmpty()
iterator()
boolean
static int
nextId()
void
void
removeByID
(int id) void
removeIndex
(T type, int position) void
resize
(float x, float y, float w, float h) Resizes the internal quadtree, if it is enabled.int
size()
void
sort
(Comparator<? super T> comp) tree()
void
update()
void
boolean
useTree()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
EntityGroup
-
EntityGroup
-
-
Method Details
-
nextId
public static int nextId() -
checkNextId
public static void checkNextId(int id) Makes sure the next ID counter is higher than this number, so future entities cannot possibly use this ID. -
checkIDCollisions
- Returns:
- entities with colliding IDs, or an empty array.
-
sort
-
collide
public void collide() -
updatePhysics
public void updatePhysics() -
update
public void update() -
copy
-
copy
-
each
-
each
-
draw
-
useTree
public boolean useTree() -
mappingEnabled
public boolean mappingEnabled() -
getByID
-
removeByID
public void removeByID(int id) -
intersect
-
intersect
-
tree
-
resize
public void resize(float x, float y, float w, float h) Resizes the internal quadtree, if it is enabled. -
isEmpty
public boolean isEmpty() -
index
-
size
public int size() -
contains
-
count
-
add
-
addIndex
-
remove
-
removeIndex
-
clear
public void clear() -
find
-
first
-
iterator
-