forked from HarbourMasters/Ghostship
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNoLogic.cpp
More file actions
56 lines (44 loc) · 1.63 KB
/
Copy pathNoLogic.cpp
File metadata and controls
56 lines (44 loc) · 1.63 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
#include "Logic.h"
extern "C" {
#include "port/ShipUtils.h"
}
namespace Rando {
namespace Logic {
void ApplyNoLogicToSaveContext(std::vector<std::vector<LevelShuffleEntry>>& initialPool,
std::vector<int16_t>& initialLevelPool) {
std::vector<LevelShuffleEntry> levelpool;
std::vector<RandoCheckId> checkPool;
std::vector<std::pair<RandoItemId, RandoAct>> itemPool;
std::vector<RandoSaveEntrance> entrancePool;
if (!initialPool.empty()) {
for (auto& level : initialPool) {
checkPool.clear();
itemPool.clear();
for (auto& entry : level) {
checkPool.push_back(entry.randoCheckId);
itemPool.push_back({ entry.randoItemId, entry.randoAct });
}
if (!itemPool.empty()) {
ShuffleRandoItems(itemPool, seedString);
for (int v = 0; v < checkPool.size(); v++) {
levelpool.push_back({ checkPool[v], itemPool[v].first, itemPool[v].second, false });
}
}
}
}
if (!initialLevelPool.empty()) {
ShuffleRandoEntrances(initialLevelPool, seedString);
for (int e = 0; e < initialLevelPool.size(); e++) {
RandoSaveEntrance randoSaveEntrance;
randoSaveEntrance.randoEntranceId = entranceIds[e];
randoSaveEntrance.destinationId = initialLevelPool[e];
entrancePool.push_back(randoSaveEntrance);
}
}
shuffledPool = levelpool;
shuffledEntrances = entrancePool;
initialPool.clear();
initialLevelPool.clear();
}
} // namespace Logic
} // namespace Rando