From 4816728c4a5bcf8fd9992f32464a1707f94c3b13 Mon Sep 17 00:00:00 2001 From: jbzdarkid Date: Thu, 21 Nov 2019 09:45:06 -0800 Subject: Symmetrical gaps are working, as are non-square puzzles --- Source/PuzzleSerializer.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Source/PuzzleSerializer.h') diff --git a/Source/PuzzleSerializer.h b/Source/PuzzleSerializer.h index 3c8f480..4d254d8 100644 --- a/Source/PuzzleSerializer.h +++ b/Source/PuzzleSerializer.h @@ -43,7 +43,7 @@ private: std::tuple loc_to_xy(const Puzzle& p, int location) const; int xy_to_loc(const Puzzle& p, int x, int y) const; - int extra_xy_to_loc(Pos pos) const; + int extra_xy_to_loc(const Puzzle& p, int x, int y) const; // Decoration location std::tuple dloc_to_xy(const Puzzle& p, int location) const; int xy_to_dloc(const Puzzle& p, int x, int y) const; @@ -52,17 +52,18 @@ private: Cell::Dot FlagsToDot(int flags) const; // Iterate connection lists for another location which is connected to us; return that other location. int FindConnection(int location) const; - void AddIntersection(int x, int y, float xPos, float yPos, int flags); + void AddIntersection(const Puzzle& p, int x, int y, float xPos, float yPos, int flags); std::shared_ptr _memory; - std::vector _intersectionLocations; + int _numGridLocations; int _numIntersections; std::vector _intersectionFlags; std::vector _connectionsA; std::vector _connectionsB; + std::vector _intersectionLocations; // Locations of non-grid points, i.e. dots, gaps, and endpoints - std::vector> _extraLocations; + std::unordered_map _extraLocations; - float MIN, MAX, WIDTH_INTERVAL, HEIGHT_INTERVAL, HORIZ_GAP_SIZE, VERTI_GAP_SIZE; + float MIN, MAX, WIDTH_INTERVAL, HEIGHT_INTERVAL, INTERVAL, GAP_SIZE; }; -- cgit 1.4.1