Commandable blocks

This commit is contained in:
Anuken
2022-02-17 16:19:07 -05:00
parent 49a39d42e7
commit 9f3af412f0
12 changed files with 177 additions and 16 deletions

View File

@@ -281,6 +281,14 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
return controller instanceof CommandAI;
}
public CommandAI command(){
if(controller instanceof CommandAI ai){
return ai;
}else{
throw new IllegalArgumentException("Unit cannot be commanded - check isCommandable() first.");
}
}
public int count(){
return team.data().countType(type);
}