Navigation

    TripleA Logo

    TripleA Forum

    • Register
    • Login
    • Search
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags

    Proposal: Automatic <property> type discovery based on value

    Map Making
    done
    1
    2
    168
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • LaFayette
      LaFayette Admin last edited by LaFayette

      Proposal:

      (1) Ignore nodes:<boolean/>, <number/> and <string/>, instead always infer them from the value attribute of a property node.
      (2) Add optional attributes to <property> :

      • min | number | default null
      • max | number | default null

      Background

      The game engine today already tries to infer the value of a property based on the value type when the value type tag is not specified. But, the engine will not infer 'boolean' types, only 'string' and 'number' types. In this proposal we would change the code to always do type inference in addition to automatically inferring 'boolean' types.

      Example, Before:

      <propertyList>
        <property name="Projection of Power" value="false">
          <boolean/>
        </property>
      
        <property name="neutralCharge" value="0">
          <number min="1" max="10000"/>
        </property>
        
        <property name="mapName" value="world_at_war">
          <string/>
        </property>
      </propertyList>
      

      Example, after:

      <propertyList>
        <property name="Projection of Power" value="false"/>
        <property name="neutralCharge" value="0" min="1" max="10000"/>  
        <property name="mapName" value="world_at_war" />
      </propertyList>
      
      1 Reply Last reply Reply Quote 2
      • LaFayette
        LaFayette Admin last edited by

        PR: https://github.com/triplea-game/triplea/pull/7651

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums