akaps / hanabi_ai

AI competition of the card game Hanabi, where the best AI is measured as the most cooperative and contributes to the highest scoring games
MIT License
1 stars 2 forks source link

RFC: use class for do_turn instead of dictionary #77

Closed akaps closed 5 years ago

akaps commented 5 years ago

Is your feature request related to a problem? Please describe. Similar to #75. You can easily make bad turns accidentally and validation is difficult with a dictionary

Describe the solution you'd like Change the returned dictionaries from do_turn to subclasses of a new Action class. Each would have a validate method to remove that check from playgame.py, and simplifies what you need to pass in (you don't need to add discard to a dictionary if you are using a DiscardAction

Describe alternatives you've considered What currently exists. It was a bit of a hassle to ensure incoming dictionaries were valid, but now its neatly factored

Additional context This is a ease-of-use question. Is implementing a bot easier if you have full control of what your turn means, or if you pass 2-3 arguments to a black box?

akaps commented 5 years ago

merged with #81