hborawski / DominionCompanion

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

Issue #33: improve tavern mat tracking #34

Closed while1fork closed 3 years ago

while1fork commented 3 years ago

This change adds the "tavernMat" attribute to all cards, and modifies getAdditionalMechanics to simply check that attribute, rather than inferring use of the Tavern Mat based on what tokens are referenced.

This change adds unit tests for the Tavern Mat which reference both a card that was causing it to be incorrectly omitted and one that was causing it to be incorrectly included. Once those were added, it seemed odd to have unit tests for that mechanic and no others, so unit tests were added for all mechanics referenced in getAdditionalMechanics for completeness (even though some of these are fairly obvious).

This PR includes changes in a large number of files, but the majority of these changes are very simple boilerplate required by the addition of an attribute to the Card model.

NOTE: This PR also includes the changes from PR https://github.com/hborawski/DominionCompanion/pull/30 for Issue 29, Prevent duplicate cards in the Set Builder shuffler. The only reason for this is because merging those changes completely separately would have caused a merge conflict in UtilitiesTest.swift, and I didn't want you to have to deal with that. If you do want to merge this change but not that one, just let me know and I'll make the appropriate changes.

Please let me know if you have questions/comments/suggestions/etc.!