Exemplo n.º 1
0
std::string gamemap::get_terrain_string(const t_translation::t_terrain& terrain) const
{
	std::stringstream ss;
	const std::string& name = get_terrain_info(terrain).description();
	const t_translation::t_list& underlying = underlying_union_terrain(terrain);
	assert(!underlying.empty());
	ss << name;
	if(underlying.size() > 1 || underlying[0] != terrain) {
		ss << " (";
        t_translation::t_list::const_iterator i = underlying.begin();
        ss << get_terrain_info(*i).name();
        while (++i != underlying.end()) {
            ss << "," << get_terrain_info(*i).name();
        }
		ss << ")";
	}
	return ss.str();
}
Exemplo n.º 2
0
std::string gamemap::get_underlying_terrain_string(const t_translation::t_terrain& terrain) const
{
	std::string str;

	const t_translation::t_list& underlying = underlying_union_terrain(terrain);
	assert(!underlying.empty());

	if(underlying.size() > 1 || underlying[0] != terrain) {
		str += " (";
        t_translation::t_list::const_iterator i = underlying.begin();
        str += get_terrain_info(*i).name();
        while (++i != underlying.end()) {
			str += ", " + get_terrain_info(*i).name();
        }
		str += ")";
	}

	return str;
}
Exemplo n.º 3
0
	const t_translation::t_list& underlying_union_terrain(const map_location& loc) const
		{ return underlying_union_terrain(get_terrain(loc)); }