Actual updating and rendering

This commit is contained in:
Anuken
2020-02-06 13:40:07 -05:00
parent 6fe5663f79
commit ddecb2d831
8 changed files with 33 additions and 16 deletions
@@ -13,6 +13,8 @@ import static mindustry.Vars.collisions;
/** Represents a group of a certain type of entity.*/
@SuppressWarnings("unchecked")
public class EntityGroup<T extends Entityc> implements Iterable<T>{
private static int lastId = 0;
private final Array<T> array;
private final Array<T> intersectArray = new Array<>();
private final Rect viewport = new Rect();
@@ -23,6 +25,10 @@ public class EntityGroup<T extends Entityc> implements Iterable<T>{
private int index;
public static int nextId(){
return lastId++;
}
public EntityGroup(Class<T> type, boolean spatial, boolean mapping){
array = new Array<>(false, 32, type);