aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/BehaviorScript.cpp
blob: e1c06b0fc99a2e0a56f2f720f6c3abdfe3a20eee (plain)
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
28
29
30
31
32
33
#include "BehaviorScript.h"
#include "Component.h"
#include "GameObject.h"

using namespace crepe;

BehaviorScript::BehaviorScript(game_object_id_t id, Mediator & mediator)
	: Component(id),
	  mediator(mediator) {}

template <>
BehaviorScript & GameObject::add_component<BehaviorScript>() {
	ComponentManager & mgr = this->mediator.component_manager;
	return mgr.add_component<BehaviorScript>(this->id, this->mediator);
}

BehaviorScript::BehaviorScript(const BehaviorScript & other) : mediator(other.mediator), Component(other.game_object_id) {
	Log::logf("COPY CONSTRUCTOR!!!");
}

BehaviorScript::BehaviorScript(BehaviorScript && other) : mediator(other.mediator), Component(other.game_object_id) {
	Log::logf("MOVE CONSTRUCTOR!!!");
}

BehaviorScript & BehaviorScript::operator = (const BehaviorScript & other) {
	Log::logf("COPY OPERATOR!!!");
	return *this;
}

BehaviorScript & BehaviorScript::operator = (BehaviorScript && other) {
	Log::logf("MOVE OPERATOR!!!");
	return *this;
}