1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <iostream>
#include <vector>
#include <list>
#include <string>
#include <sstream>
#include <algorithm>

#include "Entity.h"
#include "Component.h"

using namespace std;

Entity::~Entity() {
	//for (auto &componentPtr : componentPtrs) delete componentPtr;
}
void Entity::addComponent(Component* mComponentPtr) {
	componentPtrs.push_back(mComponentPtr);
	mComponentPtr->setParent(this);
}
void Entity::delComponent(Component* mComponentPtr) {
	//componentPtrs.erase(remove(componentPtrs.begin(), componentPtrs.end(), mComponentPtr), componentPtrs.end());
	delete mComponentPtr;
}
void Entity::update() {
	//for (auto componentPtr& : componentPtrs)
		componentPtrs[0]->update();
}