class GameTimer {
	tick:number;
	wait:number;
	trigger:Trigger;

	constructor(wait:number) {
		this.wait = wait;
		this.tick = window.getTime() + this.wait;
		this.trigger = new Trigger();
	}

	tryFire(t:number) {
		if (t >= this.tick)
			this.fire(t);
	}

	fire(t:number) {
		//TODO: ちゃんと差分とった方がいいかな？
		//TODO: こう？ window.getTime() - (window.getTime() - this.tick) + this.wait
		this.tick = t + this.wait;
		this.trigger.fire(t);
	}
}