> 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

{% 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;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://freedom-developer.gitbook.io/the-chess/honorable-mentioned/game-logic-classes.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
