Skip to content

New countable for adopted policies supports policyFilter #13191

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

Merged
merged 7 commits into from
May 30, 2025

Conversation

SomeTroglodyte
Copy link
Collaborator

This is what I hope can serve as clean example on how to create new Countables.

The only complication was that it needed a cleaner policy creating tool in the TestGame class, having uninitialized lateinits like the older createPolicy leaves isn't sufficient to run Policy.matchesFilter on.

@SomeTroglodyte SomeTroglodyte changed the title Now countable for adopted policies supports policyFilter New countable for adopted policies supports policyFilter Apr 11, 2025
Comment on lines 213 to 216
"Adopted [[Tradition] branch] Policies" to 7,
"Adopted [Liberty Complete] Policies" to 0,
"Adopted [[Liberty] branch] Policies" to 2,
"Adopted [[all] branch] Policies" to 5,
Copy link
Owner

Choose a reason for hiding this comment

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

How can All be lower than just Tradition?!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not all, all branch = started branches. Commented somewhere. Yes maybe a confusing name but this way it didn't need new translation entries. Should change to "[started] branch"? "branch starter"? Dunno.

Copy link
Owner

Choose a reason for hiding this comment

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

This is still a blocker for me, something here is either broken or unintuitive enough that the interface needs changing

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Victim of my own crimes...

  • Sorry for zoning out for a few weeks after kicking up the Expressions nest, still need to read up on ~50 unread mails
  • The actual filter support this is using was already merged in More improvements to internal Countables handling #13187, so I was searching the git log in vain for these
  • Boils down to what wording to use for "filter only those Policy instances that are a PolicyBranch
  • Maybe better remove that (already merged) filter option, remove the test here using it, and re-imagine such a filter afterwards in a new PR?

Copy link
Owner

Choose a reason for hiding this comment

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

We should fix it to return the number of policies that fit the filter, not the number of branches, if that's what it's doing

Copy link

github-actions bot commented May 1, 2025

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the Conflicts label May 6, 2025
Copy link

github-actions bot commented May 6, 2025

Conflicts have been resolved.

@SomeTroglodyte
Copy link
Collaborator Author

OK, bb9541b removes the contentious filter option entirely. When we decide on a name, we can always reintroduce it easily. ("Adopted [branch starter] Policies" maybe? The choice would need to preclude collisions with actual policy names mods may choose.)

@yairm210 yairm210 merged commit 72e0460 into yairm210:master May 30, 2025
4 checks passed
@SomeTroglodyte SomeTroglodyte deleted the PoliciesCountable branch June 16, 2025 05:35
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.

2 participants