public static Set<String> getLandSetCodeForDeckSets(Set<String> setCodesDeck) {
Set<String> setCodesland = new HashSet<>();
// decide from which sets basic lands are taken from
for (String setCode :setCodesDeck) {
ExpansionInfo expansionInfo = ExpansionRepository.instance.getSetByCode(setCode);
if (expansionInfo.hasBasicLands()) {
setCodesland.add(expansionInfo.getCode());
}
}
// if sets have no basic land, take land from block
if (setCodesland.isEmpty()) {
for (String setCode :setCodesDeck) {
ExpansionInfo expansionInfo = ExpansionRepository.instance.getSetByCode(setCode);
ExpansionInfo [] blockSets = ExpansionRepository.instance.getSetsFromBlock(expansionInfo.getBlockName());
for (ExpansionInfo blockSet: blockSets) {
if (blockSet.hasBasicLands()) {
setCodesland.add(blockSet.getCode());
}
}