Esempio n. 1
0
        ////////////////////////////////////////////////////////////////////////
        ///
        /// @fn public ZoneInfo(string nomZone, string difficulte, bool win)
        /// @brief Constructeur par parametre de la fenetre Partie Terminee.
        /// @param[in] nomZone : Nom de la zone affichee.
        /// @param[in] difficulte : difficulte de la zone de jeu
        /// @param[in] win : Indique si on a gagne la partie precedente.
        /// @return Aucune (constructeur).
        ///
        ////////////////////////////////////////////////////////////////////////
        public ZoneInfo(string nomZone, string difficulte, bool win)
        {
            InitializeComponent();
            this.Icon            = Properties.Resources.Pinball;
            this.WindowState     = FormWindowState.Normal;
            this.FormBorderStyle = FormBorderStyle.None;
            StringBuilder zoneProps = new StringBuilder(Application.StartupPath + @"\zones\" + nomZone + ".xml");
            IntPtr        config    = FonctionsNatives.obtenirProprietes(zoneProps, zoneProps.Capacity);

            Marshal.Copy(config, proprietes, 0, 5);
            if (win)
            {
                labelWin.Text = "Vous avez gagné!";
                FonctionsNatives.jouerSon(winSound, winSound.Length, false);
            }
            else
            {
                labelWin.Text = "Début de la partie";
            }
            time           = 5;
            timer1.Enabled = true;

            timer1.Interval       = 25;
            timer1.Tick          += new EventHandler(DecrementProgressBar);
            label_Zone.Text       = nomZone;
            label_Difficulte.Text = difficulte;
            label_Points.Text     = proprietes[3].ToString();
            label_Bille.Text      = proprietes[4].ToString();
            screenShot.SizeMode   = PictureBoxSizeMode.StretchImage;
            screenShot.Image      = Image.FromFile(Application.StartupPath + @"\zones\" + nomZone + ".jpg");
        }
Esempio n. 2
0
        ////////////////////////////////////////////////////////////////////////
        ///
        /// @fn private void setProprietes()
        /// @brief Affichage des proprietes dans les labels correspondants.
        /// @return Aucune.
        ///
        ////////////////////////////////////////////////////////////////////////
        private void setProprietes()
        {
            IntPtr config = FonctionsNatives.obtenirProprietes(map, map.Capacity);

            Marshal.Copy(config, proprietes, 0, 5);
            label_nbPointsButC.Text  = proprietes[0].ToString();
            label_nbPointsButT.Text  = proprietes[1].ToString();
            label_nbPointsCible.Text = proprietes[2].ToString();
            label_nbWin.Text         = proprietes[3].ToString();
            label_nbPointsBille.Text = proprietes[4].ToString();
        }