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,35 @@
package mindustry.entities.traits;
import arc.math.geom.Position;
import mindustry.game.Team;
/**
* Base interface for targetable entities.
*/
public interface TargetTrait extends Position, VelocityTrait{
boolean isDead();
Team getTeam();
default float getTargetVelocityX(){
if(this instanceof SolidTrait){
return ((SolidTrait)this).getDeltaX();
}
return velocity().x;
}
default float getTargetVelocityY(){
if(this instanceof SolidTrait){
return ((SolidTrait)this).getDeltaY();
}
return velocity().y;
}
/**
* Whether this entity is a valid target.
*/
default boolean isValid(){
return !isDead();
}
}