31 lines
714 B
Java
31 lines
714 B
Java
package net.minecraft.gametest.framework;
|
|
|
|
import com.google.common.collect.Lists;
|
|
import java.util.Collection;
|
|
|
|
public class GameTestTicker {
|
|
public static final GameTestTicker singleton;
|
|
private final Collection<GameTestInfo> testInfos;
|
|
|
|
public GameTestTicker() {
|
|
this.testInfos = Lists.newCopyOnWriteArrayList();
|
|
}
|
|
|
|
public void add(final GameTestInfo iw) {
|
|
this.testInfos.add(iw);
|
|
}
|
|
|
|
public void clear() {
|
|
this.testInfos.clear();
|
|
}
|
|
|
|
public void tick() {
|
|
this.testInfos.forEach(GameTestInfo::tick);
|
|
this.testInfos.removeIf(GameTestInfo::isDone);
|
|
}
|
|
|
|
static {
|
|
singleton = new GameTestTicker();
|
|
}
|
|
}
|