int addPSkill(SkillInfo* skill) { assert(globalSkillTable.count(skill->sid)==0 && "duplicate HeroProfile"); globalSkillTable[skill->sid] = skill; return globalSkillTable.size(); }
int addHero(HeroProfile* h) { assert(globalHeroTable.count(h->tableId)==0 && "duplicate HeroProfile"); globalHeroTable[h->tableId] = h; return globalHeroTable.size(); }
std::pair<double,double> FermiTable::calcAverageAtomicProperties (const boost::container::flat_map<string,double>& tracers) const { double total = 0; double aa = 0; double zz = 0; for(std::map<string,std::pair<double,double> >::const_iterator it= atomic_properties_.begin(); it!=atomic_properties_.end();++it){ assert(tracers.count(it->first)==1); const double mass_frac = tracers.find(it->first)->second; const double A = it->second.first; const double Z = it->second.second; total += mass_frac; aa += mass_frac/A; zz += mass_frac*Z/A; } return std::pair<double,double>(total/aa,zz/aa); }
const HeroProfile& HPT(int i) { assert(globalHeroTable.count(i) && "HeroProfile does not exist"); return *globalHeroTable[i]; }
const SkillInfo& PST(int i) { assert(globalSkillTable.count(i) && "Skill does not exist"); return *globalSkillTable[i]; }