-
Notifications
You must be signed in to change notification settings - Fork 783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new ExileReturnBattlefieldNextEndStepTargetEffect #11251
Conversation
xenohedron
commented
Oct 3, 2023
- closes Refactor: regroup together the Mistmeadow Witch kind of effect #10978
@@ -50,15 +49,15 @@ public ExileThenReturnTargetEffect copy() { | |||
@Override | |||
public boolean apply(Game game, Ability source) { | |||
Player controller = game.getPlayer(source.getControllerId()); | |||
Set<Card> toFlicker = new LinkedHashSet<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct replacement of LinkedHashSet by streams (don't use toSet, cause it can random cards order):
https://stackoverflow.com/a/51945053
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the order necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its related to UX. Example: users must see same logs and same GUI requests for same actions. LinkedHashSet helps to save that order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, well, this is probably a much broader issue in the codebase then (indiscriminate use of HashSet<>
rather than LinkedHashSet<>
in addition to the Collectors.toSet()
). I'll fix it here at least.