Ejemplo n.º 1
0
	int addPSkill(SkillInfo* skill)
	{
		assert(globalSkillTable.count(skill->sid)==0 && "duplicate HeroProfile");
        globalSkillTable[skill->sid] = skill;
        
        return globalSkillTable.size();
	}
Ejemplo n.º 2
0
 int addHero(HeroProfile* h)
 {
     assert(globalHeroTable.count(h->tableId)==0 && "duplicate HeroProfile");
     globalHeroTable[h->tableId] = h;
     
     return globalHeroTable.size();
 }
Ejemplo n.º 3
0
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);
}
Ejemplo n.º 4
0
 const HeroProfile& HPT(int i)
 {
     assert(globalHeroTable.count(i) && "HeroProfile does not exist");
     return *globalHeroTable[i];     }
Ejemplo n.º 5
0
 const SkillInfo& PST(int i)
 {
     assert(globalSkillTable.count(i) && "Skill does not exist");
     return *globalSkillTable[i];
 }