ianfab / fairyground

playground for Fairy-Stockfish in the browser
https://fairyground.vercel.app/
GNU General Public License v3.0
21 stars 5 forks source link

Convert the code style to object-oriented style #68

Open yjf2002ghty opened 5 months ago

yjf2002ghty commented 5 months ago

Most of the code are written in process-oriented style, focusing on the FSF-WASM, ffish board and chessgroundx board. An obvious characteristic is that there are almost no class in the code, making it harder to maintain especially when the code becomes more complex. Switching to object-oriented style can make it easier to handle.

The framework or stack does not need to change as all functions are working well so far (including binary engine loading feature), and my approach is to split the frontend and the backend so that they can work on their own thus implementing some features that traditional GUIs does not support such as running engines remotely (requires SSH). PKG is enough for this.