Stops the action for a specific amount of time and conveys necessary information for the given type of break
Inheritance: NetworkBehaviour
Esempio n. 1
0
        private void BreakTimer_Tick(object sender, EventArgs e)
        {
            if (minutesLeft <= 0 && secondsLeft <= 0)
            {
                BreakTimer.Stop();

                PreFocusPage preFocus = new PreFocusPage();
                preFocus.Show();
                preFocus.SetDesktopLocation(this.Bounds.X, this.Bounds.Y);
                preFocus.Activate();

                if (hideTaskbar)
                {
                    Taskbar.Hide();
                }
                this.Hide();
            }

            if (minutesLeft != 0 && secondsLeft == 0)
            {
                minutesLeft--;
                secondsLeft = 59;
            }
            else
            {
                secondsLeft--;
            }

            BreakTimerLabel.Text = minutesLeft + ":" + secondsLeft.ToString().PadLeft(2, '0');
        }
Esempio n. 2
0
        private void BreakPage_Load(object sender, EventArgs e)
        {
            Taskbar.Show();

            BreakTimerLabel.Text = minutesLeft + ":" + secondsLeft.ToString().PadLeft(2, '0');
            BreakTimer.Start();
        }
Esempio n. 3
0
        public void Stop()
        {
            Timer.Stop();
            BreakTimer.Stop();

            IsRunning = false;
        }
Esempio n. 4
0
        private void SetupButton_Click(object sender, EventArgs e)
        {
            SetupPage setup = new SetupPage();

            setup.Show();
            setup.SetDesktopLocation(this.Bounds.X, this.Bounds.Y);

            BreakTimer.Stop();
            this.Hide();
        }
Esempio n. 5
0
    /// <summary>
    /// Initialize all variables needed for this script to run.
    /// </summary>
    void Start () 
    {
        timer = GetComponent<Timer>();
        timer.SetLengthOfTimer(halfLength + 1);
        timer.Pause();
        referee = GameObject.FindGameObjectWithTag("Referee").GetComponent<Referee>();
        GameObject gameController = GameObject.FindGameObjectWithTag("GameController");
        scoreKeeper = gameController.GetComponent<ScoreKeeper>();
        ballReset = gameController.GetComponent<BallReset>();
        breakTimer = GameObject.Find("BreakTimer").GetComponent<BreakTimer>();
	}
Esempio n. 6
0
    /// <summary>
    ///     Retrieve the necessary object and script references
    /// </summary>
    void Start()
    {
        GameObject gameController = GameObject.FindGameObjectWithTag("GameController");
        gameTimer = gameController.GetComponent<GameTimer>();
        scoreKeeper = gameController.GetComponent<ScoreKeeper>();
        referee = GameObject.FindGameObjectWithTag("Referee").GetComponent<Referee>();
        breakTimer = GameObject.Find("BreakTimer").GetComponent<BreakTimer>();

        timer = gameObject.GetComponent<Timer>();
        timer.SetLengthOfTimer(announcementPauseLength);
    }
Esempio n. 7
0
    /// <summary>
    /// Gets the objects and initializes the variables to their proper values.
    /// </summary>
    void Start ()
    {
        if (isServer)
        {
            BlueTeamScore = 0;
            RedTeamScore = 0;
        }
        GameObject gameController = GameObject.FindGameObjectWithTag("GameController");

        GT = gameController.GetComponent<GameTimer>();
        BR = gameController.GetComponent<BallReset>();
        Ref = GameObject.FindGameObjectWithTag("Referee").GetComponent<Referee>();
        BT = GameObject.Find("BreakTimer").GetComponent<BreakTimer>();
	}
Esempio n. 8
0
        private void CompleteBreak()
        {
            BreakTimer.Stop();

            CurrentPosition++;

            Timer.Interval = Doros[CurrentPosition].Duration;
            Timer.Start();

            IsBreak = false;

            DoroStartTime = DateTime.Now;

            Tick(new DoroTimerEvent(DoroTimerEvent.STARTED_DORO, Doros[CurrentPosition]));
        }
        /// <summary>
        ///     Load user configuration from disk.
        /// </summary>
        public void LoadUserConfiguration()
        {
            BreakTimer configuration = UserConfigurationManager.Load <BreakTimer>();

            if (configuration == null)
            {
                BreakTimer defaultConfiguration = new BreakTimer {
                    Frequency = 0, Length = 0, IdleResetTime = 0
                };
                BreakTimer = defaultConfiguration;
            }
            else
            {
                BreakTimer = configuration;
            }
        }
Esempio n. 10
0
    /// <summary>
    /// Initializes all of the objects and variables needed for this script.
    /// </summary>
    void Start () 
    {
        GameObject GameController = GameObject.FindGameObjectWithTag("GameController");
        REF = GameObject.FindGameObjectWithTag("Referee").GetComponent<Referee>();
        BR = GameController.GetComponent<BallReset>();
        GT = GameController.GetComponent<GameTimer>();
        BT = GameObject.Find("BreakTimer").GetComponent<BreakTimer>();
        
        ballPossession = ball.GetComponent<Possession>();
        ballLocation = ball.GetComponent<ListObjectLocation>();
        timer = gameObject.AddComponent<Timer>();
        timer.SetLengthOfTimer(TimerFoulTime);
        timer.Resume();
        DeadBallTimer = gameObject.AddComponent<Timer>();
        DeadBallTimer.SetLengthOfTimer(DeadBallTime);
        DeadBallTimer.Pause();
	}
Esempio n. 11
0
        private void CompleteDoro()
        {
            Timer.Stop();

            Tick(new DoroTimerEvent(DoroTimerEvent.FINISHED_DORO, Doros[CurrentPosition]));

            if (CurrentPosition + 1 == Doros.Count)
            {
                Tick(new DoroTimerEvent(DoroTimerEvent.FINISHED, null));
                IsRunning = false;

                return;
            }

            BreakStartTime = DateTime.Now;

            BreakTimer.Interval = Doros[CurrentPosition].BreakDuration;
            BreakTimer.Start();

            IsBreak = true;
        }