diff options
author | jbzdarkid <jbzdarkid@gmail.com> | 2019-11-16 10:27:06 -0800 |
---|---|---|
committer | jbzdarkid <jbzdarkid@gmail.com> | 2019-11-16 10:27:06 -0800 |
commit | 0baa521ba34d2cd4e0f732f83d23b807605786a2 (patch) | |
tree | dfb01163d291ee846c7a5840ffc08e089a7fb8e6 /Source/Puzzle.h | |
parent | 0d0abe2ee56382c5751dd12fbca75af87773879f (diff) | |
download | witness-tutorializer-0baa521ba34d2cd4e0f732f83d23b807605786a2.tar.gz witness-tutorializer-0baa521ba34d2cd4e0f732f83d23b807605786a2.tar.bz2 witness-tutorializer-0baa521ba34d2cd4e0f732f83d23b807605786a2.zip |
More and more progress.
Split out functions in serializer Figured out how to allocate memory (for sequences)
Diffstat (limited to 'Source/Puzzle.h')
-rw-r--r-- | Source/Puzzle.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/Source/Puzzle.h b/Source/Puzzle.h index 3a8e73b..fdf51be 100644 --- a/Source/Puzzle.h +++ b/Source/Puzzle.h | |||
@@ -64,21 +64,23 @@ struct Pos {int x; int y;}; | |||
64 | 64 | ||
65 | class Puzzle { | 65 | class Puzzle { |
66 | public: | 66 | public: |
67 | int16_t height; | 67 | int16_t height = 0; |
68 | int16_t width; | 68 | int16_t width = 0; |
69 | bool hasDecorations = false; | 69 | bool hasDecorations = false; |
70 | 70 | ||
71 | enum class Symmetry {NONE, X, Y, XY}; | 71 | enum class Symmetry {NONE, X, Y, XY}; |
72 | Symmetry sym = Symmetry::NONE; | 72 | Symmetry sym = Symmetry::NONE; |
73 | bool pillar = false; | 73 | bool pillar = false; |
74 | 74 | ||
75 | bool valid; | 75 | bool valid = false; |
76 | std::vector<Negation> negations; | 76 | std::vector<Negation> negations; |
77 | std::vector<Pos> invalidElements; | 77 | std::vector<Pos> invalidElements; |
78 | 78 | ||
79 | inline Cell GetCell(int x, int y) const; | 79 | std::vector<Pos> sequence; |
80 | inline Cell::Color GetLine(int x, int y) const; | 80 | |
81 | inline void NewGrid(int newWidth, int newHeight); | 81 | Cell GetCell(int x, int y) const; |
82 | Cell::Color GetLine(int x, int y) const; | ||
83 | void NewGrid(int newWidth, int newHeight); | ||
82 | 84 | ||
83 | // @TODO: | 85 | // @TODO: |
84 | Pos GetSymmetricalPos(int x, int y); | 86 | Pos GetSymmetricalPos(int x, int y); |
@@ -86,7 +88,7 @@ public: | |||
86 | // private: | 88 | // private: |
87 | std::vector<std::vector<Cell>> grid; | 89 | std::vector<std::vector<Cell>> grid; |
88 | 90 | ||
89 | private: | 91 | // private: |
90 | inline int Mod(int x) const; | 92 | int Mod(int x) const; |
91 | inline bool SafeCell(int x, int y) const; | 93 | bool SafeCell(int x, int y) const; |
92 | }; | 94 | }; |