forked from External/mage
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:
parent
0f7db0c69d
commit
bc4aa6931f
16 changed files with 884 additions and 8 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue