tengen-io / server

:white_circle: Server implementation of the board game Go
MIT License
13 stars 4 forks source link

Begin game logic refactor #37

Closed eaceaser closed 5 years ago

eaceaser commented 5 years ago

This should be in a good place to port stuff over from rules, but I wanted to get this in front of people first.

This should be a complete implementation of Go rules (unless I forgot something?)

The main differences between the rules implementation are:

Additionally, in the rules implementation, the model is tightly wired to the board state. In fact, we're storing individual moves as DB rows it seems. This will quickly become unscalable, and is probably unnecessary, as there's no reason to query the database directly for subsets of moves. Games can be serialized when stored to the database (SGF is actually a serialization format that can be used directly, or we can roll our own), and deserialized into the in-memory representation when read.

Things to review:

Game logic may be busted in some ways that I didn't notice

The tests should be fairly complete but I probably missed some edge cases which still may not work.

Misc Changes: