From fc8649b12fc1280d81e8dd4d35736ed69c0d9909 Mon Sep 17 00:00:00 2001 From: jbzdarkid Date: Sat, 16 Nov 2019 14:22:39 -0800 Subject: Keep WIP --- Source/Randomizer2Core.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Source/Randomizer2Core.h (limited to 'Source/Randomizer2Core.h') 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 @@ +#pragma once +#include + +struct Pos; +class Puzzle; + +class Randomizer2Core { +public: + // CAUTION: Does not actually cut edges, just returns a list of suggested cuts. + // Cuts a number of edges equal to the number of colors in the color grid. + static std::vector CutEdgesToBeUnique(const Puzzle& p); + static void CutEdgesNotOutsideNotBreakingSequence(Puzzle& p, size_t numEdges); + +private: + static std::vector CutEdgesInternal(const Puzzle& p, std::vector>& colorGrid, std::vector& edges, size_t numEdges); + static void DebugColorGrid(const std::vector>& colorGrid); + static void FloodFill(const Puzzle& p, std::vector>& colorGrid, int color, int x, int y); + static void FloodFillOutside(const Puzzle& p, std::vector>& colorGrid, int x, int y); + static std::tuple>, int> CreateColorGrid(const Puzzle& p); +}; + -- cgit 1.4.1