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

Bring back pgm objective filters #939

Closed
Pablete1234 opened this issue Nov 21, 2021 · 2 comments
Closed

Bring back pgm objective filters #939

Pablete1234 opened this issue Nov 21, 2021 · 2 comments
Labels
feature New feature or request good first issue Good for newcomers reintroduce Reintroduces a feature that was removed

Comments

@Pablete1234
Copy link
Member

Current pgm only has support for the objective filter, and it is not properly documented over at pgm.dev.

We should bring back all 3 ways of parsing this filter (they all result in reusing the GoalFilter, just with different parameters in the constructor)

What 1.12+ pgm supported was:
Objective - Supports any="true" or team="team-id" - We have this already, although it is not documented.
<objective>goal-id</objective> - Matches if the team of the player is the one that completed it
<objective any="true">goal-id</objective> - Matches if ANY team completed it
<objective team="red-team">goal-id</objective> - Matches if red team completed it

Completed - Does NOT support any="true" or team="team-id"
<completed>goal-id</completed> - This is equivalent to <objective any="true">goal-id</objective>

Captured - Supports team="team-id" but does NOT support any="true"
<captured>goal-id</captured> - Matches if the team of the player is the one that completed it
<captured team="team-id">goal-id</captured> - Matches if the specific team completed it

This seems quite verbose and is probably like it is for backwards compatibility reasons, since the any="true" was added much later, and i'm assuming before you were just assumed to use completed if you wanted that behavior
They all in-code end up using the same GoalFilter with the same logic, just sometimes with a "hardcoded" team (or no-team, and checks all of them)

https://github.com/OvercastNetwork/ProjectAres/blob/master/PGM/src/main/java/tc/oc/pgm/filters/parser/FilterDefinitionParser.java#L324
https://github.com/OvercastNetwork/ProjectAres/blob/master/PGM/src/main/java/tc/oc/pgm/filters/matcher/party/GoalFilter.java
https://github.com/OvercastNetwork/ProjectAres/blob/master/PGM/src/main/java/tc/oc/pgm/filters/operator/TeamFilterAdapter.java

Footnote 1: in all places where i mentioned team i mean competitor, which means it works for FFA if you assume each "player" is a "team", obviously you can't specify a specific team in xml for ffa
Footnote 2: the filter never abstained in old pgm.

@Pablete1234 Pablete1234 added feature New feature or request good first issue Good for newcomers reintroduce Reintroduces a feature that was removed labels Nov 21, 2021
@CoWinkKeyDinkInc
Copy link
Contributor

CoWinkKeyDinkInc commented Nov 22, 2021

I got the first part documented in PGMDev/Website@8fefd12
So essentially, all these you described do the same thing as the objective attributes?

@Pablete1234
Copy link
Member Author

yeah, they are the same as objective with the specific attributes

chidddy added a commit to chidddy/PGM that referenced this issue Dec 11, 2021
chidddy added a commit to chidddy/PGM that referenced this issue Dec 11, 2021
Signed-off-by: chiddy <chiddy@chiddy.xyz>
chidddy added a commit to chidddy/PGM that referenced this issue Dec 11, 2021
Signed-off-by: chiddy <chiddy@chiddy.xyz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for newcomers reintroduce Reintroduces a feature that was removed
Development

No branches or pull requests

2 participants