Page 1 of 1
having trouble creating a second deck
Posted: 08 February 2022, 01:46
by emily_nicole
Does anyone have experience working with multiple decks for the same game?
Re: having trouble creating a second deck
Posted: 08 February 2022, 03:02
by DexterHugo
Personally, I found easiest just to create a second deck the same way I did the first deck instead of trying to co-mingle them in one object/table. So I just repeated the process (created a second table, added the constructor in php to make it a module.common.deck and then populated it in the setup). Just give it a different name to distinguish them both - something like attackDeck for the first deck and defenseDeck for the second deck.
Re: having trouble creating a second deck
Posted: 08 February 2022, 05:17
by emily_nicole
thank you, that was super helpful
Re: having trouble creating a second deck
Posted: 08 February 2022, 15:12
by Galeelox
I'm use to create only one deck for all the tokens I want to track. This prevents you from creating too many tables. And it makes it easy to create generic methods for all of your decks.
Re: having trouble creating a second deck
Posted: 08 February 2022, 18:04
by Tisaac
Galeelox wrote: ↑08 February 2022, 15:12
I'm use to create only one deck for all the tokens I want to track. This prevents you from creating too many tables. And it makes it easy to create generic methods for all of your decks.
Why would you be afraid of many db tables ?
One table for each logical component is pretty neat IMO
Re: having trouble creating a second deck
Posted: 08 February 2022, 21:44
by Galeelox
Tisaac wrote: ↑08 February 2022, 18:04
Galeelox wrote: ↑08 February 2022, 15:12
I'm use to create only one deck for all the tokens I want to track. This prevents you from creating too many tables. And it makes it easy to create generic methods for all of your decks.
Why would you be afraid of many db tables ?
One table for each logical component is pretty neat IMO
It's a part of the checklist. A reasonable database file.
But the first reason is that I didn't need to have several decks. One deck with a right usage of location is enough for all my needs.
Re: having trouble creating a second deck
Posted: 08 February 2022, 22:43
by Victoria_La
I also manager everything in one table (tokens), which is all decks, meeples, structures and other game components.
It makes it super easy to code and deal with (and I never write SQL queries in my games anymore)