forked from miki151/keeperrl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcollective_control.cpp
More file actions
60 lines (42 loc) · 1.36 KB
/
collective_control.cpp
File metadata and controls
60 lines (42 loc) · 1.36 KB
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(WCollective c) : collective(c) {
}
WCollective CollectiveControl::getCollective() const {
return NOTNULL(collective);
}
void CollectiveControl::update(bool currentlyActive) {
}
void CollectiveControl::tick() {
}
const vector<WCreature>& CollectiveControl::getCreatures() const {
return getCollective()->getCreatures();
}
void CollectiveControl::onMemberKilled(WConstCreature victim, WConstCreature killer) {
}
void CollectiveControl::onOtherKilled(WConstCreature victim, WConstCreature 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::getTriggers(WConstCollective against) const {
return {};
}
PCollectiveControl CollectiveControl::idle(WCollective col) {
return makeOwner<IdleControl>(col);
}
REGISTER_TYPE(IdleControl);