aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/ParticleEmitter.cpp
blob: e7f298ca22470fbb4bd4f31c485413844e6bcbca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "ParticleEmitter.h"
#include "Particle.h"

using namespace crepe;

ParticleEmitter::ParticleEmitter(uint32_t game_object_id, const Data & data)
	: Component(game_object_id), data(data) {
	for (size_t i = 0; i < this->data.max_particles; i++) {
		this->data.particles.emplace_back();
	}
}

ParticleEmitter::~ParticleEmitter() {
	std::vector<Particle>::iterator it = this->data.particles.begin();
	while (it != this->data.particles.end()) {
		it = this->data.particles.erase(it);
	}
}