aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/ParticleEmitter.cpp
blob: 17030261b6897974c518394d4e5cf13b49219ec7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#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);
	}
}