Knight's Tour Generator
Tourneys and the Fast Generation and Obfuscation of Closed Knight's Tours
Structs.h
Go to the documentation of this file.
1 
4 // MIT License
5 //
6 // Copyright (c) 2019 Ian Parberry
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to
10 // deal in the Software without restriction, including without limitation the
11 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 // sell copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // The above copyright notice and this permission notice shall be included in
16 // all copies or substantial portions of the Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 // IN THE SOFTWARE.
25 
26 #ifndef __Structs__
27 #define __Structs__
28 
29 #include "Includes.h"
30 #include "Defines.h"
31 
32 class CBoard; //forward declaration
33 
35 
39 
40 struct CTourneyDesc{
41  GeneratorType m_eGenerator = GeneratorType::Unknown;
42  CycleType m_eCycle = CycleType::Unknown;
43  bool m_bObfuscate = false;
44 
45  CTourneyDesc(GeneratorType gen, CycleType c, bool obfuscate=false);
46  CTourneyDesc();
47 }; //CTourneyDesc
48 
50 
54 
57 
58  int m_nWidth = 0;
59  int m_nHeight = 0;
60  int m_nSize = 0;
61 
62  bool m_bDiscard = false;
63 
64  int m_nSeed = 0;
65 
66  CSearchRequest(const CTourneyDesc& t, int w, int h, int s);
67  CSearchRequest();
68 }; //CSearchRequest
69 
71 
75 
77  CBoard* m_pBoard = nullptr;
78 
80 
81  int m_nWidth = 0;
82  int m_nHeight = 0;
83  int m_nSize = 0;
84 
85  UINT64 m_nSingleMove[8] = {0};
87 
88  CSearchResult(CBoard* b, const CTourneyDesc& t);
89  CSearchResult();
90 }; //CSearchResult
91 
93 
99 
100 struct CRect{
101  int m_nLeft = -1;
102  int m_nRight = -1;
103 
104  int m_nTop = -1;
105  int m_nBottom = -1;
106 
107  CRect(int left, int right, int top, int bottom);
108 }; //CRect
109 
110 #endif
int m_nTop
Top-most vertical co-ordinate.
Definition: Structs.h:104
int m_nLeft
Left-most horizontal co-ordinate.
Definition: Structs.h:101
Rectangle.
Definition: Structs.h:100
CTourneyDesc()
Default constructor.
Definition: Structs.cpp:45
uint64_t UINT64
Typedef of UINT64 for *NIX.
Definition: Defines.h:38
Defines, enumerated types, and typedefs.
Useful includes.
Tourney descriptor.
Definition: Structs.h:40
int m_nHeight
Board height.
Definition: Structs.h:59
CSearchResult()
Default constructor.
Definition: Structs.cpp:79
Search result.
Definition: Structs.h:76
int m_nSeed
PRNG seed.
Definition: Structs.h:64
UINT64 m_nRelativeMove[8]
Double move count.
Definition: Structs.h:86
Search request.
Definition: Structs.h:55
int m_nSize
Board size.
Definition: Structs.h:83
CSearchRequest()
Default constructor.
Definition: Structs.cpp:63
bool m_bDiscard
Discard result.
Definition: Structs.h:62
GeneratorType
Generator type.
Definition: Defines.h:47
int m_nWidth
Board width.
Definition: Structs.h:58
CBoard * m_pBoard
Pointer to chessboard.
Definition: Structs.h:77
Chessboard.
Definition: Board.h:42
int m_nRight
Right-most horizontal co-ordinate.
Definition: Structs.h:102
GeneratorType m_eGenerator
Generator type.
Definition: Structs.h:41
int m_nWidth
Board width.
Definition: Structs.h:81
CycleType m_eCycle
Cycle type.
Definition: Structs.h:42
int m_nSize
Board size.
Definition: Structs.h:60
UINT64 m_nSingleMove[8]
Single move count.
Definition: Structs.h:85
CRect(int left, int right, int top, int bottom)
Constructor.
Definition: Structs.cpp:91
CTourneyDesc m_cTourneyDesc
Tourney descriptor.
Definition: Structs.h:79
int m_nBottom
Bottom-most vertical co-ordinate.
Definition: Structs.h:105
CTourneyDesc m_cTourneyDesc
Tourney descriptor.
Definition: Structs.h:56
CycleType
Cycle type.
Definition: Defines.h:58
int m_nHeight
Board height.
Definition: Structs.h:82
bool m_bObfuscate
Whether to obfuscate.
Definition: Structs.h:43