Rudimentary rendering

This commit is contained in:
Anuken
2020-02-05 23:04:48 -05:00
parent 8172e69f8c
commit a11f6efe0a
23 changed files with 10629 additions and 10513 deletions
+4 -2
View File
@@ -12,7 +12,7 @@ import static mindustry.Vars.*;
/** Represents a group of a certain type of entity.*/
@SuppressWarnings("unchecked")
public class EntityGroup<T extends Entityc> implements Iterable<T>{
private final Array<T> array = new Array<>(false, 32);
private final Array<T> array;
private final Array<T> intersectArray = new Array<>();
private final Rect intersectRect = new Rect();
private IntMap<T> map;
@@ -21,7 +21,9 @@ public class EntityGroup<T extends Entityc> implements Iterable<T>{
private int index;
public EntityGroup(boolean spatial, boolean mapping){
public EntityGroup(Class<T> type, boolean spatial, boolean mapping){
array = new Array<>(false, 32, type);
if(spatial){
tree = new QuadTree<>(new Rect(0, 0, 0, 0));
}