Page 1 of 1

How are people handling card metadata in a deck?

Posted: 08 August 2020, 00:21
by HumanBot
So i was reading the docs for the deck class and was wondering about how developers are handling metadata for each card. Hearts is a pretty easy example because its a single deck and the value of the cards explain themselves (numbers and suites). With multiple types of decks with cards that have abilities, cost, vp, conditions, etc, I'm thinking of doing a separate array for each deck that maps each card's type_id to an array of metadata. To make it less messy for me, I was gonna throw these arrays into some php file in the /modules directory and include it into the game.php file.

Are people kind of doing it like this or is there a more built in strategy? Would love for some advice.

Re: How are people handling card metadata in a deck?

Posted: 08 August 2020, 00:31
by paramesis
That's the best way to go about it, and it's the intended usage of the material.inc.php file.

Re: How are people handling card metadata in a deck?

Posted: 08 August 2020, 00:36
by HumanBot
Oh oops, I must have missed that. Thanks for pointing that out.