Skip to content
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

Merged
merged 8 commits into from
Oct 6, 2023

Conversation

xenohedron
Copy link
Contributor

@xenohedron xenohedron requested a review from Susucre October 3, 2023 03:35
@@ -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<>();
Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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.

@xenohedron xenohedron merged commit 6e18dbd into magefree:master Oct 6, 2023
@xenohedron xenohedron deleted the mistmeadow branch October 6, 2023 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor: regroup together the Mistmeadow Witch kind of effect
2 participants