Example #1
0
        private void btnValider_Click(object sender, EventArgs e)
        {
            if (IsChampsValid() == true)
            {
                Joueur joueur = new Joueur();
                joueur.Pseudo = tbPseudo.Text;
                listeJoueurs.Add(joueur);
                Serialisation.SaveJson(@"C:\Windows\Temp\Toplayers.json", listeJoueurs);
                DialogResult result = MessageBox.Show("Félicitations, vous faites désormais partie\n" +
                                                      "du Top 10 des meilleurs joueurs de tous les temps.\n" +
                                                      "Souhaitez-vous refaire une partie?", "////***Congratulations!!!***\\\\",
                                                      MessageBoxButtons.YesNo);

                if (result == DialogResult.Yes)
                {
                    tbPseudo.Clear();
                    tbScore.Clear();

                    //Faudrait faire un gestionnaire de contextes qui renvoie au menu principal du jeu
                }
                else
                {
                    this.Close();
                    interface_Victoire.ActiveForm.Close();
                }
            }
        }
Example #2
0
        //    else
        //    {
        //        MessageBox.Show("Mot entré dans le lexique incorrect", "Erreur!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
        //    }



        //}

        //private void tbMot_Validating(object sender, CancelEventArgs e)
        //{
        //    mot.Texte = tbMot.Text;
        //    if (!Mot.IsMotValideFacile(tbMot.Text))
        //    {
        //        epLexique.SetError(btnValider, "Mot invalide");
        //    }
        //    else
        //    {
        //        epLexique.SetError(btnValider, string.Empty);
        //    }

        //}
        public void SerializeAll()
        {
            Serialisation.SaveJson(@"C:\Windows\Temp\MotsFacileJson.json", motsFacile);
            Serialisation.SaveJson(@"C:\Windows\Temp\MotsDifficileJson.json", motsDifficile);
            Serialisation.SaveJson(@"C:\Windows\Temp\MotsExpertJson.json", motsExpert);
        }