#include "Emitter.h"

std::vector<std::unique_ptr<Emitter>>EMITTER_LIST;

Emitter::Emitter(float frequency,float timer)
	:frequency(frequency),timer(timer){}

bool Emitter::Update(float fElapsedTime){
	lastEmit=std::max(lastEmit-fElapsedTime,0.f);
	if(lastEmit==0){
		lastEmit=frequency;
		Emit();
	}
	timer-=fElapsedTime;
	if(timer<0){
		return false;
	}
	return true;
}