mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
from list to set
This commit is contained in:
@@ -573,7 +573,7 @@ public class GameAction {
|
||||
}
|
||||
|
||||
if (c.hasChosenColorSpire()) {
|
||||
copied.setChosenColorID(ImmutableList.copyOf(c.getChosenColorID()));
|
||||
copied.setChosenColorID(ImmutableSet.copyOf(c.getChosenColorID()));
|
||||
}
|
||||
|
||||
// update state for view
|
||||
@@ -2236,7 +2236,7 @@ public class GameAction {
|
||||
Localizer.getInstance().getMessage("lblChooseNColors", Lang.getNumeral(2));
|
||||
SpellAbility sa = new SpellAbility.EmptySa(ApiType.ChooseColor, c, takesAction);
|
||||
sa.putParam("AILogic", "MostProminentInComputerDeck");
|
||||
List<String> chosenColors = takesAction.getController().chooseColors(prompt, sa, 2, 2, colorChoices);
|
||||
Set<String> chosenColors = new HashSet<>(takesAction.getController().chooseColors(prompt, sa, 2, 2, colorChoices));
|
||||
c.setChosenColorID(chosenColors);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars, ITr
|
||||
private String chosenType2 = "";
|
||||
private List<String> notedTypes = new ArrayList<>();
|
||||
private List<String> chosenColors;
|
||||
private List<String> chosenColorID;
|
||||
private Set<String> chosenColorID;
|
||||
private List<String> chosenName = new ArrayList<>();
|
||||
private Integer chosenNumber;
|
||||
private Player chosenPlayer;
|
||||
@@ -2121,13 +2121,13 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars, ITr
|
||||
public boolean hasChosenColor(String s) {
|
||||
return chosenColors != null && chosenColors.contains(s);
|
||||
}
|
||||
public final List<String> getChosenColorID() {
|
||||
public final Set<String> getChosenColorID() {
|
||||
if (chosenColorID == null) {
|
||||
return Lists.newArrayList();
|
||||
return Sets.newHashSet();
|
||||
}
|
||||
return chosenColorID;
|
||||
}
|
||||
public final void setChosenColorID(final List<String> s) {
|
||||
public final void setChosenColorID(final Set<String> s) {
|
||||
chosenColorID = s;
|
||||
view.updateChosenColorID(this);
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@ public class CardView extends GameEntityView {
|
||||
void updateChosenColors(Card c) {
|
||||
set(TrackableProperty.ChosenColors, c.getChosenColors());
|
||||
}
|
||||
public List<String> getChosenColorID() {
|
||||
public Set<String> getChosenColorID() {
|
||||
return get(TrackableProperty.ChosenColorID);
|
||||
}
|
||||
void updateChosenColorID(Card c) {
|
||||
|
||||
@@ -67,7 +67,7 @@ public enum TrackableProperty {
|
||||
ChosenType2(TrackableTypes.StringType),
|
||||
NotedTypes(TrackableTypes.StringListType),
|
||||
ChosenColors(TrackableTypes.StringListType),
|
||||
ChosenColorID(TrackableTypes.StringListType),
|
||||
ChosenColorID(TrackableTypes.StringSetType),
|
||||
ChosenCards(TrackableTypes.CardViewCollectionType),
|
||||
ChosenNumber(TrackableTypes.StringType),
|
||||
StoredRolls(TrackableTypes.StringListType),
|
||||
|
||||
Reference in New Issue
Block a user