diff options
author | jbzdarkid <jbzdarkid@gmail.com> | 2019-11-25 18:02:59 -0800 |
---|---|---|
committer | jbzdarkid <jbzdarkid@gmail.com> | 2019-11-25 18:02:59 -0800 |
commit | 50992a6ab44321fe925c2becaa856a31696076ea (patch) | |
tree | 1a8e51b5fc37666f94a6b062de52a424a66b9cce /Source/PuzzleSerializer.cpp | |
parent | 81fa5933d23db320934d168329b818b1868eeb6c (diff) | |
download | witness-tutorializer-50992a6ab44321fe925c2becaa856a31696076ea.tar.gz witness-tutorializer-50992a6ab44321fe925c2becaa856a31696076ea.tar.bz2 witness-tutorializer-50992a6ab44321fe925c2becaa856a31696076ea.zip |
Simplified / added two more
Diffstat (limited to 'Source/PuzzleSerializer.cpp')
-rw-r--r-- | Source/PuzzleSerializer.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/PuzzleSerializer.cpp b/Source/PuzzleSerializer.cpp index da7a336..8165fe8 100644 --- a/Source/PuzzleSerializer.cpp +++ b/Source/PuzzleSerializer.cpp | |||
@@ -157,17 +157,20 @@ void PuzzleSerializer::ReadExtras(Puzzle& p) { | |||
157 | // Note that Y coordinates are reversed: 0.0 (bottom) 1.0 (top) | 157 | // Note that Y coordinates are reversed: 0.0 (bottom) 1.0 (top) |
158 | else if (y1 < y2) p.grid[x][y].end = Cell::Dir::DOWN; | 158 | else if (y1 < y2) p.grid[x][y].end = Cell::Dir::DOWN; |
159 | else if (y1 > y2) p.grid[x][y].end = Cell::Dir::UP; | 159 | else if (y1 > y2) p.grid[x][y].end = Cell::Dir::UP; |
160 | else assert(false); | ||
160 | } else if (_intersectionFlags[i] & Flags::HAS_DOT) { | 161 | } else if (_intersectionFlags[i] & Flags::HAS_DOT) { |
161 | if (x1 < x2) x--; | 162 | if (x1 < x2) x--; |
162 | else if (x1 > x2) x++; | 163 | else if (x1 > x2) x++; |
163 | else if (y1 < y2) y++; | 164 | else if (y1 < y2) y++; |
164 | else if (y1 > y2) y--; | 165 | else if (y1 > y2) y--; |
166 | else assert(false); | ||
165 | p.grid[x][y].dot = FlagsToDot(_intersectionFlags[i]); | 167 | p.grid[x][y].dot = FlagsToDot(_intersectionFlags[i]); |
166 | } else if (_intersectionFlags[i] & Flags::HAS_ONE_CONN) { | 168 | } else if (_intersectionFlags[i] & Flags::HAS_ONE_CONN) { |
167 | if (x1 < x2) x--; | 169 | if (x1 < x2) x--; |
168 | else if (x1 > x2) x++; | 170 | else if (x1 > x2) x++; |
169 | else if (y1 < y2) y++; | 171 | else if (y1 < y2) y++; |
170 | else if (y1 > y2) y--; | 172 | else if (y1 > y2) y--; |
173 | else assert(false); | ||
171 | p.grid[x][y].gap = Cell::Gap::BREAK; | 174 | p.grid[x][y].gap = Cell::Gap::BREAK; |
172 | gapLocations[i] = Pos{x, y}; | 175 | gapLocations[i] = Pos{x, y}; |
173 | } | 176 | } |