Changes between Version 1 and Version 2 of Ticket #1358, comment 7
- Timestamp:
- Jun 15, 2012, 3:08:44 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #1358, comment 7
v1 v2 8 8 Otherwise I'm looking into this ticket, here's what I'm thinking currently for the global function: 9 9 {{{ 10 GetTechModifiedProperty(techModifications, entityTemplate, propertyValue) 10 function GetTechModifiedProperty( 11 techModifications, 12 entityTemplate, 13 propertyName, 14 propertyValue 15 ) 11 16 }}} 12 17 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. 14 19 * `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`. 15 21 * `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). 16 22