A game contains a list of children. And a boolean to indicate whether the children have actually been generated or not. Thus when the boolean is true but the children list is empty it means no move is possible: it's a endgame, either a checkmate or a stalemate.
The goal is to remove the applymove() function and unclutter processing moves in two different parts of the code. As a consequence the code inside the generate*() functions will modify the generated pieces statuses (captured and moves somewhere else).
It must follow a tree organisation.
A game contains a list of children. And a boolean to indicate whether the children have actually been generated or not. Thus when the boolean is true but the children list is empty it means no move is possible: it's a endgame, either a checkmate or a stalemate.
The goal is to remove the applymove() function and unclutter processing moves in two different parts of the code. As a consequence the code inside the generate*() functions will modify the generated pieces statuses (captured and moves somewhere else).