Originally Posted by
Andrew
alright so i have this tick
Code:
@Override
public Tickable getGameCycle() {
return new Tickable(100) {
@Override
public void execute() {
if(!gameStarted && (waitingRoom.size() + participants.size()) >= PestControl.MINIMUM_SIZE && participants.size() <= 1) {
start();
}
}
};
}
100 ticks = 60s which i know, but how would i do setter and getter for this? so i can display the time remaining on my interfaces
Code:
private int elapsed= 0;
public int getCyclesElapsed() {
return elapsed;
}
@Override
public Tickable getGameCycle() {
return new Tickable(100) {
@Override
public void execute() {
if(!gameStarted && (waitingRoom.size() + participants.size()) >= PestControl.MINIMUM_SIZE && participants.size() <= 1) {
start();
duration ++;
}
}
};
}
getGameCycle is an incorrect name tbh so is duration but I couldn't think of a word for amount of time passed by, lol.
Edit: elapsed! Lol, just popped into my mind.