﻿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(entity, tech_type, current_value) {
  var cmpTechMan = QueryOwnerInterface(entity, IID_TechnologyManager);

  if (!cmpTechMan)
    return current_value;

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

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

  if (!cmpTechMan)
    return current_value;

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

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