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

Add support for deleting nodes with constants #1256

Merged
merged 1 commit into from
Oct 15, 2023
Merged

Conversation

Pablete1234
Copy link
Member

Straight up taken from #1181:

3.4.1 Support deleting attributes using the constant

A consideration was that constants maybe should support "deleting" the attribute, example:

<map>
  <name>Map</name>
  <variant id="tournament-edition">TE</variant>
  
  <constants>
    <constant id="size">32</constant>
    <constant id="overfill" delete="true"/>
  </constants>

  <if variant="tournament-edition">
    <constant id="size">8</constant>
    <constant id="overfill">8</constant>
  </if>

  <team id="red" max="${size}" max-overfill="${overfill}"/>
  <team id="blue" max="${size}" max-overfill="${overfill}"/>
</map>

In here we want the ranked version to have max=8, max-overfill=8, and the default to have max=32, and no max-overfill at all.
Being able to set the constant to "no value" (via delete="true" to signal that you clearly are doing this on purpose, it's not that you forgot the value), it would strip the whole attribute.

@Electroid Electroid merged commit 0f6b60e into dev Oct 15, 2023
2 checks passed
@Electroid Electroid deleted the constant-deletion branch October 15, 2023 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants