Bring back pgm objective filters #939
Labels
feature
New feature or request
good first issue
Good for newcomers
reintroduce
Reintroduces a feature that was removed
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"
orteam="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 itCompleted - Does NOT support
any="true"
orteam="team-id"
<completed>goal-id</completed>
- This is equivalent to<objective any="true">goal-id</objective>
Captured - Supports
team="team-id"
but does NOT supportany="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 itThis 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 behaviorThey 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.
The text was updated successfully, but these errors were encountered: