asdfjkl / jfxchess

JFXChess - Chess Program
https://asdfjkl.github.io/jfxchess
GNU General Public License v2.0
102 stars 21 forks source link

how #142

Closed ghost closed 7 months ago

asdfjkl commented 7 months ago

Feel free to ask any particular information; but note that there is no documentation, the documentation is the code :-)

If you just want to use JFXChess, you just have to try out all options. Should hopefully be mostly self-explanatory.

As for the code: Generally, there is a message based event system.

Essentially there is a central GameState where all information about the current state of the program are contained.

All classes that have to react on changes on the gamestate (i.e. UI widgets etc.) implement the interface StateChangeListener(). In the method stateChange() these classes implement the logic of what they need to do when the gamestate changes.

Whenever a gamestate is manipulated by an object, it must call GameState.triggerStateChange() which then notifies all classes via the above interface.