com.gempukku.libgdx.graph.time.SimpleTimeKeeper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of libgdx-graph Show documentation
Show all versions of libgdx-graph Show documentation
libGDX-graph runtime library for pipeline rendering
The newest version!
package com.gempukku.libgdx.graph.time;
public class SimpleTimeKeeper implements TimeKeeper {
private boolean firstUpdate = true;
private float timeCumulative = 0;
private float delta;
private boolean paused;
@Override
public void updateTime(float delta) {
if (!paused) {
this.delta = delta;
if (!firstUpdate)
timeCumulative += delta;
firstUpdate = false;
} else {
this.delta = 0;
}
}
@Override
public float getTime() {
return timeCumulative;
}
@Override
public float getDelta() {
return delta;
}
public void pauseTime() {
paused = true;
}
public void resumeTime() {
paused = false;
}
public void setTime(float time) {
timeCumulative = time;
firstUpdate = true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy