> For the complete documentation index, see [llms.txt](https://freedom-developer.gitbook.io/the-chess/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://freedom-developer.gitbook.io/the-chess/honorable-mentioned/game-logic-classes.md).

# Game Logic Classes

Game logic are classes that manages all the computation and chess game states

{% hint style="info" %}
To use any of the classes here, static ChessAttackTable.SetupPiecesAttackTable() function had to be called in order to setup pieces attack. It just need to be called once in the entire gameplay.
{% endhint %}

<mark style="color:green;">**Game Logic Inheritence Hierachy**</mark> (Inheritence Level In Ascending Order) :

**ChessGameBase** - The base chess game logic class, do not contain chess rule such as legal move, made for moving chess without restriction.&#x20;

Used by :

1\) PlaygroundGUI

**ChessGame**  - Contain absolute chess rules and logic needed for creating a holistic, feature rich chess game including undo move, executing move,  get, convert algebraic notations related functions, check game finishing state, get legal moves etc.&#x20;

Used by :

1\) ChessBaseGUI&#x20;

2\) ChessGameBaseGUI

3\) ChessQueueableGameGUI

4\) ChessSinglePlayerGameGUI

5\) ChessMultiControlGameGUI

6\) ChessTwoPlayerGameGUI

**ChessGameScoring** - The class that record and compute chess board position score after each move.&#x20;

**ChessGameAI** - Contains all the AI logic such as draw or resign analysis, a container for commanding action towards underlying chess AI types inlcuding TypeI and TypeII AI.

Used by :&#x20;

1\) ChessGameAIGUI

2\) ChessGameMultiAIGUI

**ChessGameScoring => ChessGameMoveVariant** - The main purpose of this game logic is to record and manipulate fixed moves to different possible variants, mainly used for game analytic features. Containing pointer that's pointing to the current move, whether it's a fixed move or move variant and it's location.&#x20;

Used by :&#x20;

1\) ChessGamePGNGUI

**ChessGamePuzzle** - Containing all the puzzle logic that dictate puzzle game rules, like validate if any moves matches puzzle data etc. The game finishing rule has been overriden to solve the puzzle, other than that is failing puzzle.

Used by :&#x20;

1\) ChessPuzzleGUI

**ChessGameMoveVariant** => **ChessPuzzleEditor** - Including all the functionality that can help **ChessPuzzleEditorGUI** provide a  holistic, working puzzle editor. One distinct functionality is to cut fixed move from move variant or fixed move to move variant, at which the pointer is pointing at.&#x20;

Used by :&#x20;

1\) ChessPuzzleEditorGUI&#x20;
