yifu / chess

Chess is attempt to write a chess client and server for online playing in c++. SDL is use on the client side for graphics.
0 stars 0 forks source link

Refactor game engine #23

Open yifu opened 9 years ago

yifu commented 9 years ago

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).