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

Morph Delegate to GameManager concept #95

Closed jkomoros closed 7 years ago

jkomoros commented 7 years ago

To underline that it's not actually a game that should be modified, just have e.g. its chest used as an example.

Important after we fix #81 and #94

jkomoros commented 7 years ago

Actually JK, Delegate should be renamed GameManager. It should have all of the current delegate's methods, as well as Chest(), Storage(), NewGame(), and lose the Game bit

jkomoros commented 7 years ago

Should game manager be the thing that applies moves to the canonical games?

jkomoros commented 7 years ago
jkomoros commented 7 years ago

Should NewGame be on manager? Currently newGame just creates a game object with things init'd. But the NewGame() package methods return a new, set up game. Most of the overhead is in new manager.

... Yeah, I think that for testing the boardgame package I still want newGame so I can call setUp later. But in general usage manager.NewGame() returning a SetUp'd game is more useful and less error prone.

jkomoros commented 7 years ago

Nah, it's not useful to have manager.NewGame, because SetUp() returns its own error, and it's weird and clunky to wire that back, too.

So now everything's done on this ticket.