world/magic/source/SpellKnowledge.cpp
// Because we keep track of all spells ever learned (if they can't be cast, they're at 0),
// the "count_spells_known" function checks to see how many spells have non-zero castings
// available.
Because we keep track of all spells ever learned (if they can't be cast, they're at 0),
the "count_spells_known" function checks to see how many spells have non-zero castings
available.
Because we keep track of all spells ever learned ( if they can ' t be cast they ' re at 0 ) the " count_spells_known " function checks to see how many spells have non - zero castings available .
uint SpellKnowledge::count_spells_known() const
{
  uint spells_known = 0;
  for (const SpellKnowledgeMap::value_type& pair : spell_knowledge)
  {
    if (pair.second.get_castings() > 0) spells_known++;
  }
  return spells_known;
}
uint SpellKnowledge :: count_spells_known ( ) const { uint spells_known = 0 ; for ( const SpellKnowledgeMap :: value_type & pair : spell_knowledge ) { if ( pair . second . get_castings ( ) > 0 ) spells_known ++ ; } return spells_known ; }
Because we keep track of all spells ever learned (if they can't be cast, they're at 0),
the "count_spells_known" function checks to see how many spells have non-zero castings
available.
Because we keep track of all spells ever learned ( if they can ' t be cast they ' re at 0 ) the " count_spells_known " function checks to see how many spells have non - zero castings available .