Пример #1
0
        ////////////////////////////////////////////////////////////////////////
        ///
        /// @fn public InitialiserConfigurations()
        /// @brief Initialisation des configurations par defaut de la partie.
        ///
        /// @return Aucune.
        ///
        ////////////////////////////////////////////////////////////////////////
        private void InitialiserConfigurations()
        {
            string tempConfig = FonctionsNatives.obtenirDerniereCampagne();

            configurations = tempConfig.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            if (configurations[0] == "UN")
            {
                RB_Solo.Checked = true;
            }
            else if (configurations[0] == "DEUX")
            {
                RB_Multi.Checked = true;
            }
            else if (configurations[0] == "AI")
            {
                RB_AI.Checked = true;
            }
            for (int i = 1; i < configurations.Length; i++)
            {
                if (File.Exists(Application.StartupPath + @"\zones\" + configurations[i] + ".xml"))
                {
                    pathMap = new StringBuilder(Application.StartupPath + @"\zones\" + configurations[i] + ".xml");
                    int diff  = FonctionsNatives.obtenirDifficulte(pathMap, pathMap.Capacity);
                    var item1 = new ListViewItem(new[] { configurations[i], diff.ToString() });
                    ZonesChoisis.Items.Add(item1);
                }
                else
                {
                    pathMap = new StringBuilder(Application.StartupPath + @"\zones\default.xml");
                    int diff  = FonctionsNatives.obtenirDifficulte(pathMap, pathMap.Capacity);
                    var item1 = new ListViewItem(new[] { "default", diff.ToString() });
                    ZonesChoisis.Items.Add(item1);
                }
            }
        }