package projectzombie.time;

import mainloop.task.IMainloopTask;
import projectzombie.Main;

public class GameTimer implements IMainloopTask
{
	private static long time;
	
	public static long getTime() {
		return time;
	}
	
	public static void setTime(long v) {
		time = v;
	}
	
	public static void forceTimeUpdate(int amount) {
		time += amount;
	}

	@Override
	public boolean MainLoopDelay(long millis) {
		return millis > Main.tickrate;
	}

	@Override
	public boolean MainLoopRepeat() {
		return true;
	}

	@Override
	public void MainLoopUpdate() {
		if(Main.menu.doGameloop) {
			time += 1;
			//time = 40000;
		}
	}

	public static void resetTime() {
		time = 0;
	}
}
