engine/XML/source/XMLDeitiesReader.cpp
// Read all the deities from the XML and place them into a map keyed by deity ID.
Read all the deities from the XML and place them into a map keyed by deity ID.
Read all the deities from the XML and place them into a map keyed by deity ID .
DeityMap XMLDeitiesReader::get_deities(const XMLNode& deities_node)
{
  DeityMap deities;
  DeityPtr default_deity = std::make_shared<Deity>();
  deities.insert(make_pair(default_deity->get_id(), default_deity));
  if (!deities_node.is_null())
  {
    vector<XMLNode> deities_nodes = XMLUtils::get_elements_by_local_name(deities_node, "Deity");
    for (const XMLNode& deity_node : deities_nodes)
    {
      DeityPtr deity = parse_deity(deity_node);
      if (deity)
      {
        deities.insert(make_pair(deity->get_id(), deity));
      }
    }
  }
  return deities;
}
DeityMap XMLDeitiesReader :: get_deities ( const XMLNode & deities_node ) { DeityMap deities ; DeityPtr default_deity = std :: make_shared < Deity > ( ) ; deities . insert ( make_pair ( default_deity -> get_id ( ) , default_deity ) ) ; if ( ! deities_node . is_null ( ) ) { vector < XMLNode > deities_nodes = XMLUtils :: get_elements_by_local_name ( deities_node , " " ) ; for ( const XMLNode & deity_node : deities_nodes ) { DeityPtr deity = parse_deity ( deity_node ) ; if ( deity ) { deities . insert ( make_pair ( deity -> get_id ( ) , deity ) ) ; } } } return deities ; }
Read all the deities from the XML and place them into a map keyed by deity ID.
Read all the deities from the XML and place them into a map keyed by deity ID .
// Need a default deity, always.