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,24 @@
package mindustry.entities.units;
public class StateMachine{
private UnitState state;
public void update(){
if(state != null) state.update();
}
public void set(UnitState next){
if(next == state) return;
if(state != null) state.exited();
this.state = next;
if(next != null) next.entered();
}
public UnitState current(){
return state;
}
public boolean is(UnitState state){
return this.state == state;
}
}