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

Fixing ordering of GamePlayer in sidePanel #12958

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

RenXFlo
Copy link

@RenXFlo RenXFlo commented Oct 20, 2024

Fixed ordering for EconomyPanels in game (tested on 3 maps TWW included)

Oredering

Signed-off-by: Rene Florian <rene.florian@intrak.sk>
@CLAassistant
Copy link

CLAassistant commented Oct 20, 2024

CLA assistant check
All committers have signed the CLA.

@RenXFlo
Copy link
Author

RenXFlo commented Oct 20, 2024

@frigoref could you look at this pull request and give me feedback

Copy link
Member

@frigoref frigoref left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!
Have a look for the comments. You can close the one where nothing is to be done (PlayerOrder) and leave the other one (PlayerOrderComparator) to @DanVanAtta.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Method iterator: Forcing the iterator to work on the sorted list is likely an overkill.
  2. Method stream: Did you check that it compiles afterwards? For me I get for example:
    triplea\game-app\game-core\src\main\java\games\strategy\triplea\attachments\AbstractConditionsAttachment.java:74: error: stream() has private access in PlayerList getData().getPlayerList().stream()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Method iterator: Forcing the iterator to work on the sorted list is likely an overkill.
  2. Method stream: Did you check that it compiles afterwards? For me I get for example:
    triplea\game-app\game-core\src\main\java\games\strategy\triplea\attachments\AbstractConditionsAttachment.java:74: error: stream() has private access in PlayerList getData().getPlayerList().stream()
  1. I'll revert the change.
  2. Checked it didnt work afther I played with it and forgot to change it back. I'll change it in next commit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forcing method currentPlayers to work on the sorted list is likely an overkill. We only want it for the UI.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forcing method currentPlayers to work on the sorted list is likely an overkill. We only want it for the UI.

I'll revert the change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably something for another fix, but the methods GameStep.isXxxStep all work on the game step name while their method names ...Step refer to the GameStep object. Hence, either the methods should be rename to something like ...StepName and/or the parameters passed should be rather of type GameStep.
Also, it seems odd to me to have null a a step name.
@DanVanAtta: Can you explain why/if this is really needed?

@frigoref
Copy link
Member

@RenXFlo Did you check whether the ordering is still fixed?

@RenXFlo
Copy link
Author

RenXFlo commented Oct 20, 2024

@RenXFlo Did you check whether the ordering is still fixed?

@frigoref It is on my side aam I some anomaly ? Does it not work for you ?

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.

3 participants