NiklasKoehnecke / DoppelkopfFramework

Doppelkopf Ki Framework
4 stars 0 forks source link

Implementation of extra rules #12

Closed XPerianer closed 5 years ago

XPerianer commented 5 years ago

My feeling is, that we need a very general interface for the extra rules. I think it would make sense to have strategies(YEAH, Patterns) for the special rules, and use them in the Ruleset-class. We then need to refactor everything, so that the ruleset class is the only source of truth, in which card is trump, which card is higher, etc. When we, for example execute the Schweine strategy, (so it is activated), it would just implement that when a we see a CA, this will always be the highest card. But these could also overwrite what is trump etc.

We should try to keep this away from the "Ansagen", which will only determine which ruleset to set. And actually this can also be kept completly away from who plays with who, which we could just analyze after this game. (This is only important for giving points, but not for the ruleset).