Applying some code review comments

This commit is contained in:
Chris H
2024-06-02 21:23:16 -04:00
parent 7c9cf7f587
commit b57ed2b165
7 changed files with 14 additions and 14 deletions

View File

@@ -370,7 +370,9 @@ public class CardFactory {
// keywords not before variables
c.addIntrinsicKeywords(face.getKeywords(), false);
face.getDraftActions().forEach(c::addDraftAction);
if (face.getDraftActions() != null) {
face.getDraftActions().forEach(c::addDraftAction);
}
c.setManaCost(face.getManaCost());
c.setText(face.getNonAbilityText());

View File

@@ -2098,7 +2098,8 @@ public class CardProperty {
}
return false;
} else if (property.equals("NotedColor")) {
String colors = sourceController.getDraftNotes().get(spellAbility.getHostCard().getName());
// Should Regicide be hardcoded here or part of the property?
String colors = sourceController.getDraftNotes().get("Regicide");
if (colors == null) {
return false;
}
@@ -2108,13 +2109,15 @@ public class CardProperty {
(colors.contains("red") && card.getColor().hasRed()) ||
(colors.contains("green") && card.getColor().hasGreen());
} else if (property.equals("NotedName")) {
String names = sourceController.getDraftNotes().get(spellAbility.getHostCard().getName());
// Should Noble Banneret be hardcoded here or part of the property?
String names = sourceController.getDraftNotes().get("Noble Banneret");
if (names == null || names.isEmpty()) {
return false;
}
return names.contains(card.getName());
} else if (property.equals("NotedTypes")) {
String types = sourceController.getDraftNotes().get(spellAbility.getHostCard().getName());
// Should Paliano Vanguard be hardcoded here or part of the property?
String types = sourceController.getDraftNotes().get("Paliano Vanguard");
if (types == null || types.isEmpty()) {
return false;
}

View File

@@ -522,9 +522,6 @@ public class AbilityManaPart implements java.io.Serializable {
return getComboColors(sa);
}
String produced = this.getOrigProduced();
if (produced.contains("NotedColor")) {
produced = produced.replace("NotedColor", sa.getActivatingPlayer().getDraftNotes().get(""));
}
if (produced.contains("Chosen")) {
produced = produced.replace("Chosen", this.getChosenColor(sa));
}
@@ -665,11 +662,12 @@ public class AbilityManaPart implements java.io.Serializable {
origProduced = origProduced.replace("Chosen", getChosenColor(sa));
}
if (origProduced.contains("NotedColors")) {
// Should only be used for Paliano, the High City
if (sa.getActivatingPlayer() == null) {
return "";
}
String colors = sa.getActivatingPlayer().getDraftNotes().get(sa.getHostCard().getName());
String colors = sa.getActivatingPlayer().getDraftNotes().get("Paliano, the High City");
if (colors == null) {
return "";
}