Fix #227 (Removed exception throw)

This commit is contained in:
Rsl1122 2017-08-10 20:38:00 +03:00
parent 353af2bbad
commit eb00a94c88

View File

@ -70,9 +70,9 @@ public abstract class TimeKeeper {
*/
public void changeState(String newState, long playTime) throws IllegalArgumentException, IllegalStateException {
Verify.nullCheck(newState);
if (playTime < lastStateChange) {
throw new IllegalStateException("Given Playtime is lower than last status change time: " + playTime + " / " + lastStateChange);
}
// if (playTime < lastStateChange) {
// throw new IllegalStateException("Given Playtime is lower than last status change time: " + playTime + " / " + lastStateChange);
// }
if (state == null) {
state = newState;
}
@ -81,7 +81,7 @@ public abstract class TimeKeeper {
currentTime = 0L;
}
long diff = playTime - lastStateChange;
times.put(state, currentTime + diff);
times.put(state, currentTime + Math.abs(diff));
state = newState;
lastStateChange = playTime;
}