about summary refs log tree commit diff stats
path: root/Source/Randomizer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Randomizer.cpp')
-rw-r--r--Source/Randomizer.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/Source/Randomizer.cpp b/Source/Randomizer.cpp index 1427f4d..e70cf44 100644 --- a/Source/Randomizer.cpp +++ b/Source/Randomizer.cpp
@@ -91,14 +91,12 @@ Things to do for V2:
91 * 20 challenges with 20 consecutive seeds 91 * 20 challenges with 20 consecutive seeds
92 * Random *rotation* of desert laser redirect? 92 * Random *rotation* of desert laser redirect?
93*/ 93*/
94#include "pch.h"
94#include "Memory.h" 95#include "Memory.h"
95#include "Randomizer.h" 96#include "Randomizer.h"
96#include "ChallengeRandomizer.h" 97#include "ChallengeRandomizer.h"
97#include "Panels.h" 98#include "Panels.h"
98#include "Random.h" 99#include "Random.h"
99#include <string>
100#include <iostream>
101#include <numeric>
102 100
103template <class T> 101template <class T>
104int find(const std::vector<T> &data, T search, size_t startIndex = 0) { 102int find(const std::vector<T> &data, T search, size_t startIndex = 0) {
@@ -250,8 +248,8 @@ void Randomizer::RandomizeTown() {
250 // Ensure that we open the gate before the final puzzle (by swapping) 248 // Ensure that we open the gate before the final puzzle (by swapping)
251 int panel3Index = find(randomOrder, 3); 249 int panel3Index = find(randomOrder, 3);
252 int panel4Index = find(randomOrder, 4); 250 int panel4Index = find(randomOrder, 4);
253 randomOrder[min(panel3Index, panel4Index)] = 3; 251 randomOrder[std::min(panel3Index, panel4Index)] = 3;
254 randomOrder[max(panel3Index, panel4Index)] = 4; 252 randomOrder[std::max(panel3Index, panel4Index)] = 4;
255 ReassignTargets(orchard, randomOrder); 253 ReassignTargets(orchard, randomOrder);
256} 254}
257 255