﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc,phab_field
1692,Small technology code cleanup,Kieran P,Jonathan Waller,"Extract the if (cmpTechMan) conditional and code into a global helper function.

Also, make the whole tech engine take arguments in this order:   entity/player, tech type, current value

{{{#!js
function ApplyTechModificationsToEntity(tech_type, current_value, entity) {
  var cmpTechMan = QueryOwnerInterface(entity, IID_TechnologyManager);

  if (!cmpTechMan)
    return current_value;

  return cmpTechMan.ApplyModifications(tech_type, current_value, entity); 
}

function ApplyTechModificationsToPlayer(tech_type, current_value, player_entity) {
  var cmpTechMan = Engine.QueryInterface(player_entity, IID_TechnologyManager);

  if (!cmpTechMan)
    return current_value;

  return cmpTechMan.ApplyModifications(tech_type, current_value, plyer_entity); 
}

ApplyTechModificationsToEntity(""Health/Max"", +this.template.Max, this.entity);
ApplyTechModificationsToPlayer(""Player/MaxPopulation"", this.template.MaxPopulation, this.entity);
}}}",enhancement,new,Should Have,Alpha 12,UI & Simulation,,,,
