Skip to content

Create a New Ordering Tool for IXML Files #445

Description

@R3tes

A new tool is needed to reorder content in IXML files based on predefined sorting criteria. At a minimum, this tool should support alphabetical (A–Z) and numeric sorting (lowest to highest), but additional options should be included too decided by the team. The user should be able to pick which property in the IXML file is used for sorting and whether the sorted file replaces the original or is saved separately. This feature makes it easier to analyze and compare different aspects of the city or verify that content aligns with desired ordering conventions.

Example tool run:

<city>
  <buildable id="bbb111" name="ZetaHouse" type="garden">
    <position x="0" y="0" z="0"/>
    <size x="9" y="9" z="9"/>
    <attributes>
     <attribute name="flower-ratio" value="0.3"/>
    </attributes>
    <children/>
  </buildable>
  <buildable id="aaa222" name="AlphaTower" type="floor">
    <position x="5" y="0" z="0"/>
    <size x="11" y="13" z="9"/>
    <attributes>
      <attribute name="torches" value="3"/>
    </attributes>
    <children/>
  </buildable>
  <buildable id="ccc333" name="GammaVilla" type="floor">
    <position x="2" y="0" z="0"/>
    <size x="9" y="9" z="9"/>
    <attributes>
      <attribute name="torches" value="2"/>
    </attributes>
    <children/>
  </buildable>
</city>
java -jar OrderIXMLFiles.jar \
     --input unsorted.xml \
     --property "name" \
     --sort-type alphabetical \
     --output sortedByName.xml
<city>
  <buildable id="aaa222" name="AlphaTower" type="floor">
    <position x="5" y="0" z="0"/>
    <size x="11" y="13" z="9"/>
    <attributes>
      <attribute name="torches" value="3"/>
    </attributes>
    <children/>
  </buildable>
  <buildable id="ccc333" name="GammaVilla" type="floor">
    <position x="2" y="0" z="0"/>
    <size x="9" y="9" z="9"/>
    <attributes>
      <attribute name="torches" value="2"/>
    </attributes>
    <children/>
  </buildable>
  <buildable id="bbb111" name="ZetaHouse" type="garden">
    <position x="0" y="0" z="0"/>
    <size x="9" y="9" z="9"/>
    <attributes>
      <attribute name="flower-ratio" value="0.3"/>
    </attributes>
    <children/>
  </buildable>
</city>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions