mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-06 07:46:08 +00:00
Cleanup SRC
This commit is contained in:
@@ -1,39 +1,32 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
public class ChronoLatch
|
||||
{
|
||||
private long interval;
|
||||
private long since;
|
||||
public class ChronoLatch {
|
||||
private final long interval;
|
||||
private long since;
|
||||
|
||||
public ChronoLatch(long interval, boolean openedAtStart)
|
||||
{
|
||||
this.interval = interval;
|
||||
since = System.currentTimeMillis() - (openedAtStart ? interval * 2 : 0);
|
||||
}
|
||||
public ChronoLatch(long interval, boolean openedAtStart) {
|
||||
this.interval = interval;
|
||||
since = System.currentTimeMillis() - (openedAtStart ? interval * 2 : 0);
|
||||
}
|
||||
|
||||
public ChronoLatch(long interval)
|
||||
{
|
||||
this(interval, true);
|
||||
}
|
||||
public ChronoLatch(long interval) {
|
||||
this(interval, true);
|
||||
}
|
||||
|
||||
public void flipDown()
|
||||
{
|
||||
since = System.currentTimeMillis();
|
||||
}
|
||||
public void flipDown() {
|
||||
since = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public boolean couldFlip()
|
||||
{
|
||||
return System.currentTimeMillis() - since > interval;
|
||||
}
|
||||
public boolean couldFlip() {
|
||||
return System.currentTimeMillis() - since > interval;
|
||||
}
|
||||
|
||||
public boolean flip()
|
||||
{
|
||||
if(System.currentTimeMillis() - since > interval)
|
||||
{
|
||||
since = System.currentTimeMillis();
|
||||
return true;
|
||||
}
|
||||
public boolean flip() {
|
||||
if (System.currentTimeMillis() - since > interval) {
|
||||
since = System.currentTimeMillis();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user