Exemple #1
0
        public static void TestStats()
        {
            Console.WriteLine("***** Testing the File Reader *****\n");

            GameStatisticsManager TestMgr = new GameStatisticsManager();

            TestMgr.TestingWriteAndRead();

            TestMgr.TestWriteState();

            TestMgr.LoadEasyValue(25, "YANGKONG");
            TestMgr.LoadEasyValue(56, "BRULSTE");
            TestMgr.LoadEasyValue(12, "CHRIALE");

            TestMgr.TestWriteState();

            TestMgr.LoadEasyValue(98, "BAGGBIL");
            TestMgr.LoadEasyValue(10, "BAGGFRO");

            TestMgr.TestWriteState();

            TestMgr.SaveStats();

            TestMgr.StatisticsMenuRun();

            Console.WriteLine("{0}", Environment.UserName);

            Console.ReadLine();
        }
Exemple #2
0
        public GameGUI(int cellHeight, int cellWidth)
        {
            pixelHeight = (25 * cellHeight) + 85;
            pixelWidth  = (25 * cellWidth) + 10;
            GameData    = new Board(cellHeight, cellWidth);
            GameData.initializeBoard();
            GameData.gOverEvent += GameData_GameOverEvent;

            GameForm                 = new Form();
            GameForm.MaximizeBox     = false;
            GameForm.KeyPreview      = true;
            GameForm.FormBorderStyle = FormBorderStyle.FixedDialog;
            GameForm.Name            = "GameForm";
            GameForm.Text            = "Minesweeper";
            GameForm.ClientSize      = new Size(pixelWidth, pixelHeight);
            GameForm.KeyPress       += new KeyPressEventHandler(MainFormKeyPressAction);
            GameForm.Icon            = GameResources.GetIconImage();
            GameForm.FormClosed     += GameForm_Closing;

            // Button not shown on screen, used to steal the focus away from other things
            Button focusStealingButton = new Button();

            focusStealingButton.Size     = new Size(25, 25);
            focusStealingButton.Location = new Point(-100, -100);
            focusStealingButton.Name     = "focusStealingButton";
            GameForm.Controls.Add(focusStealingButton);

            ScoreTimer             = new GameTimer();
            ScoreTimer.gTimerTick += ScoreTimer_gTimerTick;

            OPsMenu = new OptionsMenu();
            OPsMenu.OptionsReturn += OptionsMenu_SetOptions;

            GSManager = new GameStatisticsManager();

            AMenu = new AboutMenu();

            AddToolBar();
        }