about summary refs log tree commit diff stats
path: root/Source/Randomizer2Core.h
diff options
context:
space:
mode:
authorjbzdarkid <jbzdarkid@gmail.com>2019-11-16 14:22:39 -0800
committerjbzdarkid <jbzdarkid@gmail.com>2019-11-16 14:22:39 -0800
commitfc8649b12fc1280d81e8dd4d35736ed69c0d9909 (patch)
tree7d6686c82dd6d738bdb54eb54d9989a4549cfdb5 /Source/Randomizer2Core.h
parent039b48fe49c31f6033a17aabab353b7b7696e11b (diff)
downloadwitness-tutorializer-fc8649b12fc1280d81e8dd4d35736ed69c0d9909.tar.gz
witness-tutorializer-fc8649b12fc1280d81e8dd4d35736ed69c0d9909.tar.bz2
witness-tutorializer-fc8649b12fc1280d81e8dd4d35736ed69c0d9909.zip
Keep WIP
Diffstat (limited to 'Source/Randomizer2Core.h')
-rw-r--r--Source/Randomizer2Core.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/Randomizer2Core.h b/Source/Randomizer2Core.h new file mode 100644 index 0000000..1b97fba --- /dev/null +++ b/Source/Randomizer2Core.h
@@ -0,0 +1,21 @@
1#pragma once
2#include <vector>
3
4struct Pos;
5class Puzzle;
6
7class Randomizer2Core {
8public:
9 // CAUTION: Does not actually cut edges, just returns a list of suggested cuts.
10 // Cuts a number of edges equal to the number of colors in the color grid.
11 static std::vector<Pos> CutEdgesToBeUnique(const Puzzle& p);
12 static void CutEdgesNotOutsideNotBreakingSequence(Puzzle& p, size_t numEdges);
13
14private:
15 static std::vector<Pos> CutEdgesInternal(const Puzzle& p, std::vector<std::vector<int>>& colorGrid, std::vector<Pos>& edges, size_t numEdges);
16 static void DebugColorGrid(const std::vector<std::vector<int>>& colorGrid);
17 static void FloodFill(const Puzzle& p, std::vector<std::vector<int>>& colorGrid, int color, int x, int y);
18 static void FloodFillOutside(const Puzzle& p, std::vector<std::vector<int>>& colorGrid, int x, int y);
19 static std::tuple<std::vector<std::vector<int>>, int> CreateColorGrid(const Puzzle& p);
20};
21