deeper-blue / negativei2-server

The server for Deeper Blue, an assistive chess-playing robot. Developed for the System Design Project, a 3rd year course offered at the School of Informatics, University of Edinburgh.
Other
3 stars 0 forks source link

Add initial_positions to controllerpoll response #55

Closed notexactlyawe closed 5 years ago

notexactlyawe commented 5 years ago

When the controller finishes a game, it needs to be able to reset itself to its starting state. The controller does not keep track of what pieces are where and so needs some state to reset itself based on. This PR sends it the initial_positions dictionary that's kept in the game object in the response to /controllerpoll. This means that the controller can check the game_over field to find out if it needs to reset, and if it does then it can use the initial_positions dictionary to reset itself since the dictionary keeps track of the initial position of every piece on the board.

For context on the object, see #40