Skip to content

Commit

Permalink
Added GameTimerSchedule.getCurrent function for getting current state (
Browse files Browse the repository at this point in the history
  • Loading branch information
TheKaVu committed May 24, 2023
1 parent 925fc8c commit 6cc891a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/dev/kavu/gameapi/GameTimerSchedule.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ public void addStates(List<GameState> gameStates){
schedule.addAll(gameStates);
}

public GameState getCurrent() {
if(index < schedule.size()) {
return schedule.get(index);
}
return GameState.EMPTY;
}

public GameState next() {
GameState state;
if(index + 1 < schedule.size()) {
Expand Down

0 comments on commit 6cc891a

Please sign in to comment.