Ejemplo n.º 1
0
        public static void create_map_size_files(string path, Dictionary <string, string> map_sizes_dictionary)
        {
            string name = map_sizes_dictionary["Name"];

            string maps_contents      = XML_Creator.Compose_File_Maps(map_sizes_dictionary);
            string map_sizes_contents = XML_Creator.Compose_File_MapSizes(map_sizes_dictionary);

            create_Maps_xml(path, name, maps_contents);
            create_MapSizes_xml(path, name, map_sizes_contents);
        }
Ejemplo n.º 2
0
        public static void create_map_script_files(string dst_path, Dictionary <string, string> map_scripts_dictionary, List <Dictionary <string, string> > map_scripts_options)
        {
            /*Generate Standard_Maps File */
            string name = map_scripts_dictionary["Name"];
            string standard_maps_contents = XML_Creator.Compose_File_Standard_Maps(map_scripts_dictionary);

            //create StandardMaps_xml file
            create_StandardMaps_xml(dst_path, name, standard_maps_contents);

            /*Copy Script File */
            copy_script_file(map_scripts_dictionary["FilePath"], dst_path, name);


            /*Generate MapSettings file */
            string mapSettings_xml = XML_Creator.Compose_File_Map_Settings(map_scripts_options); //returns combined input for xml file

            create_MapSettings_xml(dst_path, name, mapSettings_xml);
        }
        /*
         * =======================================================================
         * Compose MapSettings file addition
         * Based on original Civ6/Base/Assets/Configuration/Data/MapSettings.xml
         * =======================================================================
         */
        public static string Compose_File_Map_Settings(List <Dictionary <string, string> > list_of_settings)
        {
            List <XElement> xml_list = new List <XElement>(); //a list of xml entries of the same type

            XElement combined_map_settings;

            foreach (Dictionary <string, string> setting_instance in list_of_settings)
            {
                XElement tmp = XML_Creator.Compose_single_Map_Settings(setting_instance);
                xml_list.Add(tmp);
            }
            if (xml_list.Any())
            {
                combined_map_settings = combine_map_parameters(xml_list);
            }
            else
            {
                return(""); //return empty string if no lists are selected (no options)
            }
            return(combined_map_settings.ToString());
        }