Exemplo n.º 1
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();
}
Exemplo n.º 2
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();
}