summary refs log tree commit diff stats
path: root/Source/PuzzleSerializer.h
diff options
context:
space:
mode:
authorjbzdarkid <jbzdarkid@gmail.com>2019-11-21 09:45:06 -0800
committerjbzdarkid <jbzdarkid@gmail.com>2019-11-21 09:45:06 -0800
commit4816728c4a5bcf8fd9992f32464a1707f94c3b13 (patch)
tree511335b92d2e16f1e057deda9a4c21d41ab43b78 /Source/PuzzleSerializer.h
parentd5bce3bba23a5ba4c296f1783ba277bcc206736c (diff)
downloadwitness-tutorializer-4816728c4a5bcf8fd9992f32464a1707f94c3b13.tar.gz
witness-tutorializer-4816728c4a5bcf8fd9992f32464a1707f94c3b13.tar.bz2
witness-tutorializer-4816728c4a5bcf8fd9992f32464a1707f94c3b13.zip
Symmetrical gaps are working, as are non-square puzzles
Diffstat (limited to 'Source/PuzzleSerializer.h')
-rw-r--r--Source/PuzzleSerializer.h11
1 files changed, 6 insertions, 5 deletions
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:
43 43
44 std::tuple<int, int> loc_to_xy(const Puzzle& p, int location) const; 44 std::tuple<int, int> loc_to_xy(const Puzzle& p, int location) const;
45 int xy_to_loc(const Puzzle& p, int x, int y) const; 45 int xy_to_loc(const Puzzle& p, int x, int y) const;
46 int extra_xy_to_loc(Pos pos) const; 46 int extra_xy_to_loc(const Puzzle& p, int x, int y) const;
47 // Decoration location 47 // Decoration location
48 std::tuple<int, int> dloc_to_xy(const Puzzle& p, int location) const; 48 std::tuple<int, int> dloc_to_xy(const Puzzle& p, int location) const;
49 int xy_to_dloc(const Puzzle& p, int x, int y) const; 49 int xy_to_dloc(const Puzzle& p, int x, int y) const;
@@ -52,17 +52,18 @@ private:
52 Cell::Dot FlagsToDot(int flags) const; 52 Cell::Dot FlagsToDot(int flags) const;
53 // Iterate connection lists for another location which is connected to us; return that other location. 53 // Iterate connection lists for another location which is connected to us; return that other location.
54 int FindConnection(int location) const; 54 int FindConnection(int location) const;
55 void AddIntersection(int x, int y, float xPos, float yPos, int flags); 55 void AddIntersection(const Puzzle& p, int x, int y, float xPos, float yPos, int flags);
56 56
57 std::shared_ptr<Memory> _memory; 57 std::shared_ptr<Memory> _memory;
58 58
59 std::vector<float> _intersectionLocations; 59 int _numGridLocations;
60 int _numIntersections; 60 int _numIntersections;
61 std::vector<int> _intersectionFlags; 61 std::vector<int> _intersectionFlags;
62 std::vector<int> _connectionsA; 62 std::vector<int> _connectionsA;
63 std::vector<int> _connectionsB; 63 std::vector<int> _connectionsB;
64 std::vector<float> _intersectionLocations;
64 // Locations of non-grid points, i.e. dots, gaps, and endpoints 65 // Locations of non-grid points, i.e. dots, gaps, and endpoints
65 std::vector<std::tuple<int, int, int>> _extraLocations; 66 std::unordered_map<int, int> _extraLocations;
66 67
67 float MIN, MAX, WIDTH_INTERVAL, HEIGHT_INTERVAL, HORIZ_GAP_SIZE, VERTI_GAP_SIZE; 68 float MIN, MAX, WIDTH_INTERVAL, HEIGHT_INTERVAL, INTERVAL, GAP_SIZE;
68}; 69};