refactor: extract shared card insertion algorithm from hand/stack zones

Hand and stack zones had near-identical addCardImpl() implementations, differing only in whether resetState() preserves annotations.
Extract the shared pattern into a template function (CardZoneAlgorithms::addCardToList) to eliminate duplication and enable isolated testing without Qt dependencies.
Pile, table, and zone-view logic are intentionally excluded — thier post-add behavior (signals, coordinate placement, hidden cards) is materially different.
This commit is contained in:
DawnFire42 2026-03-14 13:14:27 -04:00
parent 8180d2e3b0
commit b49083f8d3
No known key found for this signature in database
GPG key ID: 24BB855EE2911B33
6 changed files with 272 additions and 26 deletions

View file

@ -60,6 +60,7 @@ target_link_libraries(
${TEST_QT_MODULES}
)
add_subdirectory(add_card_algorithm)
add_subdirectory(carddatabase)
add_subdirectory(loading_from_clipboard)
add_subdirectory(oracle)