Exemplo n.º 1
0
 void PrintTotalScore()
 {
     try
     {
         log.Debug("in the PrintTotalScore()");
         Console.Clear();
         int ts = totalScore;
         totalScore = 0;
         bool isHighest = false;
         if (Reader.ReadIt() < ts)
         {
             Writer.WriteIt("" + ts);
             isHighest = true;
         }
         Console.Write(ConfigurationManager.AppSettings["TotalAndHighestScore"], ts, Reader.ReadIt());
         if (isHighest == true)
         {
             Gaps.LineBreak(1);
             Gaps.TabsSpaces(3);
             Console.Write(ConfigurationManager.AppSettings["CongratsMessage"]);
         }
         Console.ReadKey();
         Console.Clear();
     }
     catch (Exception e) {
         log.Error("Exceptio in PrintTotalScore(), Error: " + e.Message);
     }
     log.Debug("out of the PrintTotalScore()");
 }
Exemplo n.º 2
0
        public static void MainManager()
        {
            try
            {
                log.Debug("Entered in the MainManager function.");
                Gaps.LineBreak(5);        //a function to break lines
                Gaps.TabsSpaces(3);       //a function to give tabs spaces.
                Message.WelcomeMessage(); //it will display welcome message.
                Gaps.Sleeps(3);           //a function for sleep.
                Console.Clear();
                Gaps.TabsSpaces(1);
                Gaps.LineBreak(2);

                while (true)
                {
                    Message.QuestionAboutMode();// asks Question form the suer.
                    Console.Write("\n Option: ");
                    String option = Console.ReadLine();
                    option = option.ToLower();
                    if (option.Equals("exit"))
                    {
                        Environment.Exit(0);
                    }
                    else if (option.Equals("continue"))//this will led you to the game.
                    {
                        Game game = new Game_Of_Cards.Game();
                        Console.Clear();
                        game.play();
                    }
                    else if (option.Equals("manual"))//this will led you to the manual of the game.
                    {
                        Message.ManualMess();
                        Console.WriteLine(ConfigurationManager.AppSettings["CorrectValuePlease"]);//it will display message to enter the correct value.
                        Console.ReadKey();
                    }
                    else
                    {
                        Console.WriteLine(ConfigurationManager.AppSettings["CorrectValuePlease"]);
                        Console.WriteLine(ConfigurationManager.AppSettings["PressAnykey"]);//it will display mesage to Press any key.
                        Console.ReadKey();
                    }
                    log.Debug("out of the MainManager function.");
                    Console.Clear();
                }
                //   log.Debug("out of the MainManager function.");
            }
            catch (Exception e)
            {
                log.Error("Error in main " + e.Message);
                Console.WriteLine(e);
            }
            Console.ReadKey();
        }
Exemplo n.º 3
0
 public static void QuestionAboutMode()
 {
     try
     {
         log.Debug("In Message class, in QuestionAboutMode() function. ");
         Gaps.LineBreak(2);
         Gaps.TabsSpaces(3);
         //   ConfigurationManager.AppSettings["WelcomeMessage"]);
         Console.Write(ConfigurationManager.AppSettings["MainMenu"]);
         Gaps.LineBreak(1);
         Console.Write(ConfigurationManager.AppSettings["DoYouKnow"]);
         log.Debug("In Message class, out QuestionAboutMode() function. ");
     }
     catch (Exception e)
     {
         log.Error("In Message class IInd function: " + e.Message);
     }
 }