TripleA Logo TripleA Forum
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags
    • Register
    • Login

    Proposal: Automatic <property> type discovery based on value

    Scheduled Pinned Locked Moved Map Making
    done
    2 Posts 1 Posters 332 Views 1 Watching
    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.
    • LaFayetteL Offline
      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
      • LaFayetteL Offline
        LaFayette Admin
        last edited by

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

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • 1 / 1
        • First post
          Last post
        Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums