I am coding a small chess game. I have a chess board with some pieces on it. On hovering a piece, I’d like to show potential places you can move to.
I have been thinking about the UI and I can see two different options :
1. Have one big logic call after every action where I receive full state of board and every available moves for chess pieces and have it accessible from the UI.
2. Have a lightweight state of the board and call the logic to compute the available moves only when a specific chess piece is hovered.
Is one solution better than the other ? Would both of them be scalable ? Is there a standard way to do it ?