-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot.cpp
32 lines (23 loc) · 890 Bytes
/
plot.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
#include "plot.h"
#include "level.h"
void PlotCrafting::execute_crafting()
{
auto& people_mapping = AccessWorld_UseUnique<PeopleMapping>::access_unique();
TCODRandom* rng = TCODRandom::getInstance();
int event_id = 0;
int size = (int)social_interactions.size();
if (size == 0)
return;
int murder_index = rng->getInt(0, size - 1);
social_interactions[murder_index](people_mapping, event_id++, entt::null, true);
for (int i = 0; i < size; i++)
if (i != murder_index)
social_interactions[i](people_mapping, event_id++, entt::null, false);
auto people = people_mapping.get_all_people_shuffled();
for (int i = 0; i < size; i++)
{
social_interactions[i](people_mapping, event_id++, people.back(), false);
people.pop_back();
}
people_mapping.graph->print();
}