forked from miki151/keeperrl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcollective_control.cpp
60 lines (42 loc) · 1.44 KB
/
collective_control.cpp
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include "stdafx.h"
#include "collective_control.h"
#include "collective.h"
#include "attack_trigger.h"
SERIALIZE_DEF(CollectiveControl, SUBCLASS(OwnedObject<CollectiveControl>), collective)
SERIALIZATION_CONSTRUCTOR_IMPL(CollectiveControl);
CollectiveControl::CollectiveControl(Collective* c) : collective(c) {
}
void CollectiveControl::update(bool currentlyActive) {
}
void CollectiveControl::tick() {
}
const vector<Creature*>& CollectiveControl::getCreatures() const {
return collective->getCreatures();
}
void CollectiveControl::onMemberKilledOrStunned(Creature* victim, const Creature* killer) {
}
void CollectiveControl::onOtherKilled(const Creature* victim, const Creature* killer) {
}
CollectiveControl::~CollectiveControl() {
}
class IdleControl : public CollectiveControl {
public:
using CollectiveControl::CollectiveControl;
virtual void tick() override {
}
SERIALIZATION_CONSTRUCTOR(IdleControl);
template <class Archive>
void serialize(Archive& ar, const unsigned int version) {
ar & SUBCLASS(CollectiveControl);
}
};
vector<TriggerInfo> CollectiveControl::getAllTriggers(const Collective* against) const {
return {};
}
vector<TriggerInfo> CollectiveControl::getTriggers(const Collective* against) const {
return getAllTriggers(against).filter([](auto t) { return t.value > 0; });
}
PCollectiveControl CollectiveControl::idle(Collective* col) {
return makeOwner<IdleControl>(col);
}
REGISTER_TYPE(IdleControl);