it is done

This commit is contained in:
Anuken
2019-12-25 01:39:38 -05:00
parent 5b21873f3c
commit 514d4817c8
488 changed files with 4572 additions and 4574 deletions

View File

@@ -0,0 +1,42 @@
package mindustry.entities.traits;
import mindustry.entities.EntityGroup;
public interface Entity extends MoveTrait{
int getID();
void resetID(int id);
default void update(){}
default void removed(){}
default void added(){}
EntityGroup targetGroup();
@SuppressWarnings("unchecked")
default void add(){
if(targetGroup() != null){
targetGroup().add(this);
}
}
@SuppressWarnings("unchecked")
default void remove(){
if(getGroup() != null){
getGroup().remove(this);
}
setGroup(null);
}
EntityGroup getGroup();
void setGroup(EntityGroup group);
default boolean isAdded(){
return getGroup() != null;
}
}