Page 1 of 1
How to castom location at Deck function
Posted: 25 September 2022, 07:25
by Yu-wolf-or-Oru
Hi everyone,
Im new to BGA,programming,english... and I want to implement my own game.
Question↓
I want to custom location at Deck.
How to create new location other than "deck","hand","discard"?
Sorry for this perhaps so easy question.
Greetings
Oru
Re: How to castom location at Deck function
Posted: 25 September 2022, 10:17
by robinzig
Everything you need is in the
Deck component docs.
In particular, see the references to the `location` argument/column. This is a VARCHAR database column so you can put any string in there you want as a location name, to manage whatever locations your game has where cards can be.
Re: How to castom location at Deck function
Posted: 26 September 2022, 12:52
by Yu-wolf-or-Oru
Dear robinzig
Thank you very much for your kindness.
I understand the 'location'.
In other words, 'deck','hand'and'discard' are special 'location' but I can also set them up arbitrarily myself.That is to say!
Re: How to castom location at Deck function
Posted: 26 September 2022, 22:13
by robinzig
Yu-wolf-or-Oru wrote: ↑26 September 2022, 12:52
Dear robinzig
Thank you very much for your kindness.
I understand the 'location'.
In other words, 'deck','hand'and'discard' are special 'location' but I can also set them up arbitrarily myself.That is to say!
I'm not sure if this is a further question or not. But to hopefully make a bit clearer - "deck", "hand" and "discard" aren't really special. They're just predefined location names you can use and there are built-in methods in the Deck class that interact with them directly. But there are also general methods that allow you to move cards to, or retrieve the cards from, any location at all with whatever name you want to come up with. So you can do whatever you want in terms of location names - you're not limited by these "predefined" ones (even though they are used in the majority of games which involve cards).
Re: How to castom location at Deck function
Posted: 27 September 2022, 15:05
by Yu-wolf-or-Oru
Dear robinzig
Thank you so much!
You answered everything I wanted to ask.
I appreciate your thoughtful response (*'ω'*)ノ