Ejemplo n.º 1
0
        static void lanceFenJeu(int typeJeu)
        {
            FenJeu fen = null;

            switch (typeJeu)
            {
            case 0:
                fen = new FenJeuNiv();
                break;

            case 1:
                fen = new FenJeuMontre();
                break;

            case 2:
                fen = new FenJeuSurvie();
                break;
            }

            if (fen != null)
            {
                Application.Run(fen);
                if (fen != null && fen.getRevenirDebut())
                {
                    lanceFenDepart();
                }
            }

            Environment.Exit(0);
        }
Ejemplo n.º 2
0
        public MenuNiv(FenJeuNiv parent)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //

            this.parent       = parent;
            this.folderSnake  = parent.getFolderSnake();
            this.folderConfig = parent.getFolderConfig();
            this.filsConfig   = parent.getFilsConfig();

            if (parent.verifExistFile(filsConfig))
            {
                using (StreamReader strmReader = new StreamReader(filsConfig)) {
                    String   ligne = strmReader.ReadLine();
                    String[] tabConfig;

                    if (ligne != null)
                    {
                        tabConfig = ligne.Split(';');

                        saisieHauteJeu.Text       = tabConfig[0];
                        saisieLargJeu.Text        = tabConfig[1];
                        saisieTailleSnake.Text    = tabConfig[2];
                        saisieTailleSnake.Maximum = (int)((float)1 / 3 * (int.Parse(tabConfig[0]) * int.Parse(tabConfig[1])));
                        saisieVit.Text            = tabConfig[3];
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public StatistiqueNiv(FenJeuNiv parent)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //

            this.parent      = parent;
            this.folderSnake = parent.getFolderSnake();
            this.filsSave    = parent.getFilsSave();

            lireRecordNivs();
        }