Page 1 of 1

Stock and Relationships to Deck

Posted: 05 May 2020, 19:17
by Samami
Aloha,
I'm having a hard time wrapping my head around stock. I have gone through the Hearts tutorial, and have read the heck out of the documentation, but I don't understand why most examples have stock as "MyHand". Is it because it's JS and front end and each player gets a copy of this?
Deck makes sense to me, I have a deck and it puts things in different places, and I want stock to be the same and it doesn't seem to be.
What am I missing?
Specifically I have a game where the cards go in the middle of the table, then players can take that card or pass. In my head, the stock is just a single deck of cards, not one for each of the players.
Mahalo,
Sam

Re: Stock and Relationships to Deck

Posted: 05 May 2020, 21:24
by DrKarotte
Stock simply offers some functions to display elements of a kind on client side, order them by value, move them from one stock to another. The deck a structure with helping functions like moving cards, shuffling on server side, connected to a database.