Exemplo n.º 1
0
        public void StartTimers2()
        {
            List <Podcast> pList = pHandler.getPodList();

            foreach (Podcast pod in pList)
            {
                tService.StartTimer(pod);
            }
        }
Exemplo n.º 2
0
    void OnTriggerEnter2D(Collider2D collider)
    {
        if (collider.gameObject.tag == "Ball")
        {
            _ballController = collider.GetComponent <BallController>();
            _ballController.StuckInTree();

            _timer.StartTimer();
        }
    }
Exemplo n.º 3
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow (UIScreen.MainScreen.Bounds);

            // XXX explain ui_iosViewController
            viewController = new ui_iosViewController ();
            window.RootViewController = viewController;
            window.MakeKeyAndVisible ();

            timerService = new TimerService ();
            timerService.StartTimer ();

            return true;
        }
Exemplo n.º 4
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);

            // XXX explain ui_iosViewController
            viewController            = new ui_iosViewController();
            window.RootViewController = viewController;
            window.MakeKeyAndVisible();

            timerService = new TimerService();
            timerService.StartTimer();

            return(true);
        }
Exemplo n.º 5
0
        public static void StartQuiz()
        {
            if (questionCount <= QuizSettings.setNumQuestions)
            {
                if (!TimerService.IsQuizStarted)
                {
                    Task.Run(() => TimerService.StartTimer());
                }
                GenerateQuestions();
                GenerateAnswers();
                answerChosen = Console.ReadLine();
                if (getAnswerKey == answerChosen)
                {
                    Console.WriteLine("CORRECT!");
                    scoreNumOfRight             = scoreNumOfRight + 1;
                    scoreKeeper.numberOfCorrect = scoreNumOfRight;
                    questionCount = questionCount + 1;
                    System.Threading.Thread.Sleep(2000);
                    Console.Clear();
                    GenerateQuiz();
                }
                else
                {
                    if (answerChosen.ToUpper() == "EXIT")
                    {
                        isQuizStarted = false;
                        Console.Clear();
                        ShowMenu();
                    }
                    else
                    {
                        Console.WriteLine("SORRY THAT IS INCORRECT!");
                        scoreNumOfWrong           = scoreNumOfWrong + 1;
                        scoreKeeper.numberOfWrong = scoreNumOfWrong;
                        questionCount             = questionCount + 1;
                        System.Threading.Thread.Sleep(2000);
                        Console.Clear();
                        GenerateQuiz();
                    }
                }
            }
            else
            {
                stopWatch.Stop();
                // Get the elapsed time as a TimeSpan value.
                TimeSpan ts = stopWatch.Elapsed;

                // Format and display the TimeSpan value.

                string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
                                                   ts.Hours, ts.Minutes, ts.Seconds,
                                                   ts.Milliseconds / 10);
                string logText = "PLAYER: " + QuizSettings.SetPlayerName + "\nNumber Answered Correct: " + scoreKeeper.numberOfCorrect +
                                 " Number of Incorrect: " + scoreKeeper.numberOfWrong + "\nLength of Time: " + elapsedTime + " \n" + Environment.NewLine;
                string logPath = QuizSettings.GlobalLogPath + QuizSettings.LogName;

                File.AppendAllText(logPath, logText);

                Console.WriteLine("Game Over\n");
                Console.WriteLine(logText);
                System.Threading.Thread.Sleep(3500);
                ResetData();
                Console.Clear();
                ShowMenu();
            }
        }
Exemplo n.º 6
0
 public void StartFeedTimer(Feed feed)
 {
     TimerService.StopTimer(feed);
     TimerService.StartTimer(feed);
 }