about summary refs log tree commit diff stats
path: root/Source/Randomizer.cpp
diff options
context:
space:
mode:
authorjbzdarkid <jbzdarkid@gmail.com>2019-11-25 21:10:50 -0800
committerjbzdarkid <jbzdarkid@gmail.com>2019-11-25 21:10:50 -0800
commitac83733b590f3c0750bea1de3556ceb24fa0a4b1 (patch)
tree74aa45ca76603f23c027478af4c2c5aa09eab11e /Source/Randomizer.cpp
parente10243a64e0c6542c9b74c3bb95f5ebf4a3df7cb (diff)
downloadwitness-tutorializer-ac83733b590f3c0750bea1de3556ceb24fa0a4b1.tar.gz
witness-tutorializer-ac83733b590f3c0750bea1de3556ceb24fa0a4b1.tar.bz2
witness-tutorializer-ac83733b590f3c0750bea1de3556ceb24fa0a4b1.zip
Using PCH to clean up includes
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