0xFableOrg / 0xFable

A fully on-chain trading card game. There will be elves, wizards & shit. Drama and broken friendships also.
https://twitter.com/0xFableGame
BSD 3-Clause Clear License
105 stars 38 forks source link

Add Deck Validity Status when Constructing Deck #111

Open eviterin opened 10 months ago

eviterin commented 10 months ago

There are currently three constraints for a deck to be considered valid:

  1. Number of cards >= 10
  2. Number of cards <= 62
  3. Copies of same card <= 3

The deck not fulfilling these constraints should not hinder them from saving the deck. But they will instead be enforced before every game.

It would make sense to create some indicators for the player while they are modifying their deck on the validity status. Also, it would be good if the player could see the validity status of all their decks from the collection view.

Finally, a player may not own more than 256 decks. It would be good if the player could see how many decks out of these 256 they have. We'll need to add a warning when that limit is reached + hide the "new deck" button when that occurs.

norswap commented 10 months ago

To clarify, the check made before the game is already implemented here and run currently! It's implemented here

So that only leaves the check in the frontend, we can do that by calling the implementation and checking if it throws an error (and down the line use the specific error to print a message that points out the specific problem).

I'm not sure what constructor you're referring to in the title?

Regarding the deck limitation, I wouldn't worry about it too much, 256 is plenty, we'll just need to add a warning when that limit is reached + hide the "new deck" button when that occurs.