hborawski / DominionCompanion

Companion app for card game Dominion
GNU General Public License v3.0
1 stars 1 forks source link

Prevent duplicate cards in the Set Builder shuffler #29

Closed while1fork closed 3 years ago

while1fork commented 3 years ago

The expansions "Base" and "Base (1st Edition)" share a large number of cards, as do the expansions "Intrigue" and "Intrigue (1st Edition)". Some gamers effectively have both editions of one or both of these expansions, either through purchasing them separately, or by purchasing the corresponding "2nd Edition Update Pack", but still wish to play with the 1st Edition cards that were removed from the 2nd Edition.

Currently, when both "Base" and "Base (1st Edition)" expansions (or the Intrigue equivalents) are selected, the shuffler can generate a set which contains the same card twice, once from each set (actually two distinct cards from cards.json with the same name but different expansions).

The cleanest way to correct this (in terms of data consistency) would probably be to separate Cards and Expansions into two separate lists, with relationships between them defined, but this is probably overkill for a small application whose feature scope will probably not expand significantly (due to being largely complete already). I believe a simple deduplication method in the Utilities class would be the simplest way to accomplish this, with minimal changes to the overall software design.

hborawski commented 3 years ago

Resolved in #34