forked from miki151/keeperrl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcollective_builder.h
53 lines (47 loc) · 1.35 KB
/
collective_builder.h
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
#pragma once
#include "enums.h"
#include "util.h"
#include "minion_trait.h"
class Tribe;
class TribeId;
class Level;
class Creature;
class ImmigrantInfo;
class Position;
class CollectiveConfig;
struct CollectiveName;
class ContentFactory;
class CollectiveBuilder {
public:
CollectiveBuilder(const CollectiveConfig&, TribeId, string enemyId);
CollectiveBuilder& setModel(Model*);
CollectiveBuilder& setLevel(Level*);
CollectiveBuilder& addCreature(Creature*, EnumSet<MinionTrait>);
CollectiveBuilder& addArea(const vector<Vec2>&);
CollectiveBuilder& setLocationName(const string&);
CollectiveBuilder& setRaceName(const string&);
CollectiveBuilder& setDiscoverable();
TribeId getTribe();
void setCentralPoint(Vec2);
bool hasCentralPoint();
PCollective build(const ContentFactory*) const;
bool hasCreatures() const;
optional<CollectiveName> generateName() const;
string enemyId;
private:
optional<CollectiveName> getCollectiveName();
Model* model = nullptr;
Level* level = nullptr;
struct CreatureInfo {
Creature* creature = nullptr;
EnumSet<MinionTrait> traits;
};
vector<CreatureInfo> creatures;
HeapAllocated<CollectiveConfig> config;
HeapAllocated<TribeId> tribe;
vector<Vec2> squares;
optional<Vec2> centralPoint;
optional<string> locationName;
optional<string> raceName;
bool discoverable = false;
};