forked from HarbourMasters/Ghostship
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogic.h
More file actions
65 lines (50 loc) · 1.76 KB
/
Copy pathLogic.h
File metadata and controls
65 lines (50 loc) · 1.76 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
60
61
62
63
64
65
#ifndef RANDO_LOGIC_H
#define RANDO_LOGIC_H
#include "port/Rando/Rando.h"
#include "port/ShipUtils.h"
struct LevelShuffleEntry {
RandoCheckId randoCheckId;
RandoItemId randoItemId;
RandoAct randoAct;
bool obtained;
bool skipped;
};
namespace Rando {
namespace Logic {
// Initial Check Shuffling containers
extern std::vector<std::vector<LevelShuffleEntry>> shuffledList;
extern std::vector<LevelShuffleEntry> shuffledLevelList;
extern std::vector<RandoCheckId> shuffledChecks;
extern std::vector<std::pair<RandoItemId, RandoAct>> shuffledItems;
// Initial Entrance Shuffling containers
extern std::vector<RandoEntranceId> entranceIds;
extern std::vector<int16_t> levelIds;
// Final Shuffle List
extern std::vector<LevelShuffleEntry> shuffledPool;
extern std::vector<RandoSaveEntrance> shuffledEntrances;
void ShuffleRandoItems(std::vector<std::pair<RandoItemId, RandoAct>>& shuffledItems, const std::string& input);
void ShuffleRandoEntrances(std::vector<int16_t>& shuffledLevels, const std::string& input);
void InitializeSaveChecks();
void InitializeSaveEntrances();
void InitializeSaveOptions();
void GenerateShuffleList();
void ApplyNoLogicToSaveContext(std::vector<std::vector<LevelShuffleEntry>>& initialPool,
std::vector<int16_t>& initialLevelPool);
// Logic Operators
inline bool IsBlueSwitchActivated(RandoCheckId randoCheckId) {
if (Rando::StaticData::Checks[randoCheckId].randoItemId == RI_COIN_BLUE) {
return true;
}
return false;
};
inline bool IsCheckShuffled(RandoCheckId randoCheckId) {
for (auto& entry : shuffledPool) {
if (entry.randoCheckId == randoCheckId) {
return true;
}
}
return false;
}
} // namespace Logic
} // namespace Rando
#endif // RANDO_LOGIC_H