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

Use Set instead of a list for entity properties, for sortability #794

Merged
merged 1 commit into from
Oct 28, 2022

Conversation

kostmo
Copy link
Member

@kostmo kostmo commented Oct 27, 2022

It is possible for list to contain duplicates or items in unpredictable order.

@kostmo kostmo marked this pull request as ready for review October 27, 2022 05:18
@kostmo kostmo requested a review from byorgey October 27, 2022 05:19
@kostmo kostmo added the Z-Refactoring This issue is about restructuring the code without changing the behaviour to improve code quality. label Oct 27, 2022
Copy link
Member

@byorgey byorgey left a comment

Choose a reason for hiding this comment

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

Makes sense, not sure why I didn't do it this way from the beginning. 😄

@kostmo kostmo added the merge me Trigger the merge process of the Pull request. label Oct 28, 2022
@mergify mergify bot merged commit 3600615 into main Oct 28, 2022
@mergify mergify bot deleted the set-of-entity-properties branch October 28, 2022 04:25
mergify bot pushed a commit that referenced this pull request Oct 29, 2022
When the inventory pane is selected (Alt+e), one can use the `;` and `:` keys to cycle sort criteria and sort direction, respectively.
![Screenshot from 2022-10-26 21-52-11](https://user-images.githubusercontent.com/261693/198195262-e0ba6f22-cdda-4a29-bc99-398f721a1ed5.png)

This functionality is implemented in a new module to avoid exacerbating #707.

Note that `entityProperties` may be an unreliable criteria to sort, because it is a list that itself may contain duplicates or items in unpredictable order.  Perhaps this field should be made a `Set` (#794).
kostmo added a commit that referenced this pull request Nov 5, 2022
Consider this an extension of #794
@kostmo kostmo mentioned this pull request Nov 5, 2022
mergify bot pushed a commit that referenced this pull request Nov 5, 2022
This PR consists of two commits:
1. Refactor list of capabilities to sets (continuation of #794)
2. Instead of hard-coding drill names, select equipped entities by their `drill` capability

This allows scenario authors to define their own drills.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Trigger the merge process of the Pull request. Z-Refactoring This issue is about restructuring the code without changing the behaviour to improve code quality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants