Exemplo n.º 1
0
        ////////////////////////////////////////////////////////////////////////
        ///
        /// @fn private void RecommencerTout()
        /// @brief Reinitialise la campagne ou la partie rapide lorsqu'on termine.
        ///
        /// @return Aucune.
        ///
        ////////////////////////////////////////////////////////////////////////
        public void RecommencerTout()
        {
            if (gameOver.Enabled)
            {
                gameOver.Hide();
            }

            pointsPartie = 0;
            currentZone  = 0;
            map          = new StringBuilder(myMaps[0]);
            nextMap      = new StringBuilder(map.ToString());
            nextMap.Remove(nextMap.Length - 4, 4);
            Program.myCustomConsole.Hide();
            this.Hide();
            zInfo = new ZoneInfo(Path.GetFileName(nextMap.ToString()), FonctionsNatives.obtenirDifficulte(map, map.Capacity).ToString(), false);
            zInfo.ShowDialog();
            this.Show();
            if (Program.mMenu.modeJeuMain != null)
            {
                Program.myCustomConsole.Show();
                Program.mMenu.modeJeuMain.Focus();
            }
            FonctionsNatives.ouvrirXML(map, map.Capacity);
            FonctionsNatives.resetNombreDePointsDePartie();
            FonctionsNatives.resetNombreBillesCourantes();
            FonctionsNatives.construireListesPalettes();
            currentZone = 1;
            peutAnimer  = true;
            boolTemp    = true;
            FonctionsNatives.jouerSon(bgm, bgm.Length);
            /// La création de l'état s'occupe d'appeler resetConfig
            etat = new EtatJeuDebutDePartie(this);
            // Il faut changer le mode car le traitement de début est fini
            etat = new EtatJeuJouer(this);

            // gameOver.Close();
            gameOver.Dispose();
            label_Nom.Text = "Nom: " + Path.GetFileNameWithoutExtension(map.ToString());
        }