Class EntityGroup<T extends mindustry.gen.Entityc>

java.lang.Object
mindustry.entities.EntityGroup<T>
All Implemented Interfaces:
Iterable<T>

public class EntityGroup<T extends mindustry.gen.Entityc> extends Object implements Iterable<T>
Represents a group of a certain type of entity.
  • Constructor Details

    • EntityGroup

      public EntityGroup(Class<T> type, boolean spatial, boolean mapping)
    • EntityGroup

      public EntityGroup(Class<T> type, boolean spatial, boolean mapping, EntityIndexer indexer)
  • 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

      public Seq<T> checkIDCollisions()
      Returns:
      entities with colliding IDs, or an empty array.
    • sort

      public void sort(Comparator<? super T> comp)
    • collide

      public void collide()
    • updatePhysics

      public void updatePhysics()
    • update

      public void update()
    • copy

      public Seq<T> copy()
    • copy

      public Seq<T> copy(Seq<T> arr)
    • each

      public void each(Cons<T> cons)
    • each

      public void each(Boolf<T> filter, Cons<T> cons)
    • draw

      public void draw(Cons<T> cons)
    • useTree

      public boolean useTree()
    • mappingEnabled

      public boolean mappingEnabled()
    • getByID

      @Nullable public T getByID(int id)
    • removeByID

      public void removeByID(int id)
    • intersect

      public void intersect(float x, float y, float width, float height, Cons<? super T> out)
    • intersect

      public Seq<T> intersect(float x, float y, float width, float height)
    • tree

      public QuadTree 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

      public T index(int i)
    • size

      public int size()
    • contains

      public boolean contains(Boolf<T> pred)
    • count

      public int count(Boolf<T> pred)
    • add

      public void add(T type)
    • addIndex

      public int addIndex(T type)
    • remove

      public void remove(T type)
    • removeIndex

      public void removeIndex(T type, int position)
    • clear

      public void clear()
    • find

      @Nullable public T find(Boolf<T> pred)
    • first

      @Nullable public T first()
    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T extends mindustry.gen.Entityc>