jkomoros / boardgame

An in-progress framework in golang to easily build boardgame Progressive Web Apps
Apache License 2.0
31 stars 4 forks source link

Consider popping moves.Base, DefaultGameDelegate into separate package #639

Closed jkomoros closed 6 years ago

jkomoros commented 6 years ago

Named defaults. Would allow a global IsFixUp() method to cast the move to see if it has FixUp and then return the value as a convenience (so that boardgame.Move can lose that method, which is weird to be in the base package given it doesn't actually do anything)

Originally captured in #633.

jkomoros commented 6 years ago

Also, should they be named the same thing?

jkomoros commented 6 years ago

Also could move boardgame.BaseSubState, probably others

jkomoros commented 6 years ago
jkomoros commented 6 years ago

A lot of the tests in the main package rely on defaultgamedleegate. Could just duplicate the code into the main package for testing, or could pop out the game logic into an internal testgame package. (The main package can't trigger it because it'd need to import it and that would create a cycle.) This would also resolve an issue of the generic test game (what issue number is that?)