We generate all possible moves(regardless of blocking) for all pieces once here. This technique saves a huge amount of computation for the Engine, as it only has to look up these moves and test their legality on a given board - instead of actually generating them each time a move is performed.
More...
|
| cgMoveGenerator (byte width=8, byte height=8) |
| Generate all possible moves for a board of the provided size. More...
|
|
List< int > | EmulateBishopAt (int pos) |
| Emulates all possible bishop movements from target index position. More...
|
|
List< int > | EmulateKingAt (int indexPosition) |
| Emulates all possible king movement from target index position More...
|
|
List< int > | EmulateRookAt (int pos) |
| Emulates all possible rook movements from target index position. More...
|
|
List< int > | EmulateQueenAt (int pos) |
| Emulates all possible queen movements from target index position. More...
|
|
List< int > | EmulateKnightAt (int indexPosition) |
| Emulates all possible knight movements from target index position. And the knight is a tricky motherF!?cker to generate moves for. More...
|
|
List< int > | EmulatePawnAt (int indexPosition, bool white) |
| Emulates all possible pawn movements from target index position. More...
|
|
List< int > | FindRayMoves (List< int > directions, int indexPosition) |
| Moves as far in each direction as possible without going outside the chess board. More...
|
|
We generate all possible moves(regardless of blocking) for all pieces once here. This technique saves a huge amount of computation for the Engine, as it only has to look up these moves and test their legality on a given board - instead of actually generating them each time a move is performed.
◆ cgMoveGenerator()
cgMoveGenerator.cgMoveGenerator |
( |
byte |
width = 8 , |
|
|
byte |
height = 8 |
|
) |
| |
Generate all possible moves for a board of the provided size.
- Parameters
-
width | Number of columns of board |
height | Number of rows of board |
◆ EmulateBishopAt()
List<int> cgMoveGenerator.EmulateBishopAt |
( |
int |
pos | ) |
|
Emulates all possible bishop movements from target index position.
- Parameters
-
pos | The 0-64 index position |
- Returns
- All possible moves.
◆ EmulateKingAt()
List<int> cgMoveGenerator.EmulateKingAt |
( |
int |
indexPosition | ) |
|
Emulates all possible king movement from target index position
- Parameters
-
indexPosition | The 0-64 index position |
- Returns
◆ EmulateKnightAt()
List<int> cgMoveGenerator.EmulateKnightAt |
( |
int |
indexPosition | ) |
|
Emulates all possible knight movements from target index position. And the knight is a tricky motherF!?cker to generate moves for.
- Parameters
-
pos | The 0-64 index position |
- Returns
- All possible moves.
◆ EmulatePawnAt()
List<int> cgMoveGenerator.EmulatePawnAt |
( |
int |
indexPosition, |
|
|
bool |
white |
|
) |
| |
Emulates all possible pawn movements from target index position.
- Parameters
-
pos | The 0-64 index position |
- Returns
- All possible moves.
◆ EmulateQueenAt()
List<int> cgMoveGenerator.EmulateQueenAt |
( |
int |
pos | ) |
|
Emulates all possible queen movements from target index position.
- Parameters
-
pos | The 0-64 index position |
- Returns
- All possible moves.
◆ EmulateRookAt()
List<int> cgMoveGenerator.EmulateRookAt |
( |
int |
pos | ) |
|
Emulates all possible rook movements from target index position.
- Parameters
-
pos | The 0-64 index position |
- Returns
- All possible moves.
◆ FindRayMoves()
List<int> cgMoveGenerator.FindRayMoves |
( |
List< int > |
directions, |
|
|
int |
indexPosition |
|
) |
| |
Moves as far in each direction as possible without going outside the chess board.
- Parameters
-
directions | Directions, as specified by how much it should add to the current position, i.e -9 = top left, -8 = top, -7 = top right, -1=left, 1 = right etc. |
indexPosition | Starting position |
- Returns
- A List of all possible moves inside the 1x64 chess board
The documentation for this class was generated from the following file:
- code/engine/logic/moves/cgMoveGenerator.cs