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 kg) {
        this.testInfos.add(kg);
    }
    
    public void clear() {
        this.testInfos.clear();
    }
    
    public void tick() {
        this.testInfos.forEach(GameTestInfo::tick);
        this.testInfos.removeIf(GameTestInfo::isDone);
    }
    
    static {
        singleton = new GameTestTicker();
    }
}
