コード例 #1
0
ファイル: map.cpp プロジェクト: Yossarian/WesnothAddonServer
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();
}
コード例 #2
0
ファイル: map.cpp プロジェクト: gaconkzk/wesnoth
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;
}
コード例 #3
0
ファイル: map.hpp プロジェクト: asimonov-im/wesnoth
	const t_translation::t_list& underlying_union_terrain(const map_location& loc) const
		{ return underlying_union_terrain(get_terrain(loc)); }