engine/XML/source/XMLItemReader.cpp
// Typically, all items of a particular type have the same symbol, with a colour based on
// the item type.  Sometimes this needs to be overridden, which is what this function 
// allows.
Typically, all items of a particular type have the same symbol, with a colour based on
the item type.  Sometimes this needs to be overridden, which is what this function
allows.
Typically all items of a particular type have the same symbol with a colour based on the item type . Sometimes this needs to be overridden which is what this function allows .
void XMLItemReader::parse_text_details(ItemPtr item, const XMLNode& text_details_node)
{
  if (item && !text_details_node.is_null())
  {
    string symbol_s = XMLUtils::get_child_node_value(text_details_node, "Symbol");
    if (!symbol_s.empty())
    {
      uchar symbol = symbol_s.at(0);
      item->set_symbol(symbol);
    }
    Colour colour = static_cast<Colour>(XMLUtils::get_child_node_int_value(text_details_node, "Colour"));
    item->set_colour(colour);
  }
}
void XMLItemReader :: parse_text_details ( ItemPtr item , const XMLNode & text_details_node ) { if ( item && ! text_details_node . is_null ( ) ) { string symbol_s = XMLUtils :: get_child_node_value ( text_details_node , " " ) ; if ( ! symbol_s . empty ( ) ) { uchar symbol = symbol_s . at ( 0 ) ; item -> set_symbol ( symbol ) ; } Colour colour = static_cast < Colour > ( XMLUtils :: get_child_node_int_value ( text_details_node , " " ) ) ; item -> set_colour ( colour ) ; } }
Typically, all items of a particular type have the same symbol, with a colour based on
the item type.
Typically all items of a particular type have the same symbol with a colour based on the item type .
// This function will only be used in a few places - to differentiate rocks from // other missiles, for example.