You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had an idea to factor out the common play logic for action classes.
Currently, every derived Action class has to copy/paste the following at the beginning of its play() function:
logger.info(f"{player} plays {self}")
ifgeneric_play:
super().generic_play(player)
I propose factoring this common logic out into the base Actionplay() method and calling the base function in derived classes:
super().play(player, game, generic_play)
It's possible we could take this a step further and have the base play() method handle the basic +cards, +actions, +money, and +buys:
I had an idea to factor out the common play logic for action classes.
Currently, every derived
Action
class has to copy/paste the following at the beginning of itsplay()
function:I propose factoring this common logic out into the base
Action
play()
method and calling the base function in derived classes:It's possible we could take this a step further and have the base
play()
method handle the basic +cards, +actions, +money, and +buys:As a result, vanilla cards like Village, Market, etc. would not need to implement a
play()
method at all.What are your thoughts?
The text was updated successfully, but these errors were encountered: