Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Solo model architecture / Card Ordering #70

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

davidkaufmann
Copy link
Collaborator

This PR aims to introduce solo's to the game logic.

The Idea is to use different card orderings, taking advantage of using the exact same approach of how cards are evaluated in the standard game.

This is achieved by dynamically replacing card order within the card object. As the deck object is handling card creation, it felt natural to provide a new rules enum and pass on a list of rules to the deck.

Going with this approach it's easy to dynamically change the rules, as is visible within the preview component, where it has been implemented for illustration purposes. deck.refreshRules(rules) is all it needs.

I believe this approach is straightforward and is of good architecture considering coupling and cohesion.

Although it works out quite well, I dislike the fact that cards contain list of cards. On a technical side it's fine, since it's shallow copies - it just doesn't feel very natural to use it this way.
I couldn't come up with something better, so the whole approach stands for discussion.
Card ordering is something that might be done more decent too, currently it's either "calculating" or generating it by removing and adding cards.

What's missing:

  • Can't select a reservation and apply a new ruleset
  • No dedicated AI for other rules
    • Can't play against reservation
    • Not able to detect a good reservation

@davidkaufmann davidkaufmann added feature feature ideas or requests discussion labels Jan 12, 2022
@hamvocke
Copy link
Owner

Awesome! Thank you. I will take a look over the next few days. Just leaving a quick FYI here:

What's missing: Can't select a reservation and apply a new ruleset

I've picked up the work on that a few days ago (before I got sidetracked by migrating to vue3...) 💪

@davidkaufmann
Copy link
Collaborator Author

I've picked up the work on that a few days ago (before I got sidetracked by migrating to vue3...) 💪

That's what I meant with

as is visible within the preview component, where it has been implemented for illustration purposes.

I integrated it into your work, you can see your hand previewing the order of the solo selected 🚀

grafik

Notice the order of the Non-Trump cards, we have a "dulle" behind the clubs and spades cards, beeing a hearts card.

Looking forward to your feedback!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
discussion feature feature ideas or requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants