Changes between Version 1 and Version 2 of Ticket #1358, comment 7


Ignore:
Timestamp:
Jun 15, 2012, 3:08:44 AM (12 years ago)
Author:
historic_bruno

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1358, comment 7

    v1 v2  
    88Otherwise I'm looking into this ticket, here's what I'm thinking currently for the global function:
    99{{{
    10 GetTechModifiedProperty(techModifications, entityTemplate, propertyValue)
     10function GetTechModifiedProperty(
     11     techModifications,
     12     entityTemplate,
     13     propertyName,
     14     propertyValue
     15)
    1116}}}
    1217
    13  * `techModifications`: comes from the tech manager which stores a mapping of propertyName -> modificationsArray for the player's researched techs, it needs to be sent to UI/AI each turn. IMO it's simpler to reuse that data because it already encapsulates both researched techs and the parsed modifications data. As a further simplification, the caller passes in something like: `g_CurrentTechModifications[propertyName]` instead of the whole object and a separate `propertyName`.
     18 * `techModifications`: comes from the tech manager which stores a mapping of propertyName -> modificationsArray for the player's researched techs, it needs to be sent to UI/AI each turn. IMO it's simpler to reuse that data because it already encapsulates both researched techs and the parsed modifications data.
    1419 * `entityTemplate`: raw template for the given entity, currently only used for its `Identity.Classes` element - maybe we can just pass in a classes array?
     20 * `propertyName`: the property we want to modify, e.g. `"Heal/HP"`. It's a key into `techModifications`.
    1521 * `propertyValue`: current value of the property being modified, we have to do this because we can't infer the type from the entityTemplate (see above).
    1622