Ready for review: Implement Craft mechanic (#11352)

* [LCI] Implement Spring-Loaded Sawblades / Bladewheel Chariot

* [LCI] Implement Sunbird Standard / Sunbird Effigy

* card filter needs to have an owner predicate

* [LCI] Implement Throne of the Grim Captain / The Grim Captain

* make default constructor for craft with artifact

* dedupe some code

* refactor constructors for simplicity

* add currently failing test
This commit is contained in:
Evan Kranzler 2023-10-27 22:32:11 -04:00 committed by GitHub
parent 0f7db0c69d
commit bc4aa6931f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 884 additions and 8 deletions

View file

@ -56,8 +56,12 @@ public abstract class RoleAssignment<T> implements Serializable {
}
public int getRoleCount(Cards cards, Game game) {
return getRoleCount(cards.getCards(game), game);
}
public int getRoleCount(Set<? extends Card> cards, Game game) {
Map<UUID, Set<T>> attributeMap = new HashMap<>();
cards.getCards(game).forEach(card -> attributeMap.put(card.getId(), this.makeSet(card, game)));
cards.forEach(card -> attributeMap.put(card.getId(), this.makeSet(card, game)));
if (attributeMap.size() < 2) {
return attributeMap.size();
}