Ejemplo n.º 1
0
void load_hex_editor_tiles()
{
    std::map<std::string, hex_tile_ptr>::const_iterator it = get_hex_tile_map().begin();
    while(it != get_hex_tile_map().end()) {
        if(it->second->get_editor_info().type.empty() == false) {
            get_editor_hex_tile_map()[it->second->get_editor_info().type] = it->second;
        }
        ++it;
    }
}
Ejemplo n.º 2
0
void load_hex_tiles(variant node)
{
    if(!get_hex_tile_map().empty()) {
        get_hex_tile_map().clear();
    }
    foreach(const variant& key, node.get_keys().as_list()) {
        std::string keys = key.as_string();
        get_hex_tile_map()[keys] = hex_tile_ptr(new hex_tile(keys, node[key]));
    }

    // get list of all tiles have non-empty "editor_info" blocks.
    if(!get_hex_editor_tiles().empty()) {
        get_hex_editor_tiles().clear();
    }
    load_editor_tiles();

    if(!get_editor_hex_tile_map().empty()) {
        get_editor_hex_tile_map().clear();
    }
    load_hex_editor_tiles();
}
Ejemplo n.º 3
0
void load_hex_tiles(variant node)
{
	if(!get_tile_type_map().empty()) {
		get_tile_type_map().clear();
	}
	for(auto p : node.as_map()) {
		std::string key_str = p.first.as_string();
		get_tile_type_map()[key_str] = tile_type_ptr(new tile_type(key_str, p.second));
	}

	// get list of all tiles have non-empty "editor_info" blocks.
	if(!get_hex_editor_tiles().empty()) {
		get_hex_editor_tiles().clear();
	}
	load_editor_tiles();

	if(!get_editor_hex_tile_map().empty()) {
		get_editor_hex_tile_map().clear();
	}
	load_hex_editor_tiles();
}