johnameyer / cards-ts

A card game framework and various games in Typescript. The framework allows for bot development and playing card games in the terminal or in a browser.
6 stars 2 forks source link

GameManager component wrapper #45

Open johnameyer opened 3 years ago

johnameyer commented 3 years ago

As outlined in #42 , there isn't a real pressing need to have the ResponseValidator, StateTransformer, or GameStateIterator broken out as separate components in the exports. As such there should be a 'GameManager' class that contains the logic to instantiate those components as well as use them in the common paths. As well, we can then add a 'test' (typescript type assertion) to check the types.

johnameyer commented 3 years ago

Current work of the 'common paths' functionality indicates that the class will need some sort of parameterization vis-a-vis the number of players and their handlers. Not sure what this would look like currently however.

johnameyer commented 8 months ago

The number of players would likely need to be included in the game-params class in such a way that we know it is a parameter across all game types. (Are there other parameters like this?)