-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Spanish deck and ability to make a partial deck without specific card values #108
base: master
Are you sure you want to change the base?
Conversation
…new spanish deck depending on whether query param deck_type exists or not
Thanks for your help!
Rather than having a new deck type field etc. This seems a lot simpler to me, with the added bonus of being able to switch languages mid game, or have a game where one player is English speaking, and another is Spanish speaking. |
Thank you for the response! My idea was also to have the ability to implement more kinds of decks (german, italian, tarot, w/e) in a more modular way in the future, thus having different card codes, separated pictures (within a directory of the same name as deck_type) and the deck_type field. I can understand that in the end this can be rather bloaty. I think this and the former reasons respond to the CARDS definition and pictures for Spanish cards points. As for the language matter that you mention, I didn't really think about it since I didn't imagine any English speaker using a Spanish deck for playing so I just wrote only the original names of the cards. English names could definitely be added. I hope I covered everything and explained better why I did this regarding your questions, if not then I just filled the PR with a lot of text 😆 |
Sorry, I'm taking so long to respond. I see what you're saying. It does seem more congruent to have separate Spanish codes, I guess I'm just not sure if it's worth the bloat or not. |
No problem at all! No need to hurry. First thing I thought of, while doesn't really reduce the bloat, at least it doesn't clutter the main code. Next one was to, instead of manually writing all codes into a list, list all of them using At some point I actually tried this while implementing it but didn't do it in the end since at the time I though this would sacrifice having the ability to create a new deck that is ordered since there isn't a proper way to sort the resulting list, or at least I didn't know how. CARDS = [f.replace(".jpg","") for f in os.listdir("./static/img/"+deck_type)]
# deck_type = "spanish" in this case Following this, in order to get that ordered list I recently thought of just simply adding the order into the pictures' filename, I hope this can bring some light into that issue. |
Sorry I am so slow. I was looking at this again today. |
Definitely, deck_type could be used for those games. You could implement any kind of deck as long one provides, ideally, definitions and pictures, along with the modifications in the rest of the code, but I think this also implies the same issue that came up before if people were to provide them. Don't get me wrong, by no means I'm against it. You are totally right on that it would have to read on every request, didn't really think about it. However I wonder if it has to read only every time In any case, take your time. |
Added the ability to create a deck of a specific type (only have done it for the spanish deck, including pictures of all cards). This can be related to #6 since it mentions the german deck.
Also added the ability to create a partial deck but indicating which values (i.e.: 8s or 9s) you don't want in the deck, especially meant for the former feature.
Documentation has also been updated with these features.