public IntervalButton(Vector2 position, IntervalButton previous,
                              IntervalButton subsequent, float time)
            : base(position)
        {
            this.position    = position;
            this.currentTime = time;

            this.previous   = previous;
            this.subsequent = subsequent;

            if (previous != null)
            {
                previousTime = previous.previousTime;
            }
            else
            {
                previousTime = 0;
            }

            if (subsequent != null)
            {
                subsequentTime = subsequent.subsequentTime;
            }
            else
            {
                subsequentTime = currentTime;
            }

            displayText = currentTime.ToString();
        }
Beispiel #2
0
        public void SetTimeVector(float[] timings)
        {
            this.timings = timings;
            timeVector   = new IntervalButton[timings.GetLength(0)];

            for (int n = 0; n < timings.Length; n++)
            {
                if (n == 0)
                {
                    timeVector[n] = new IntervalButton(new Vector2(25, LevelMechanics.CalculateYPos(n)), null, null, 0);
                    timeVector[n].Initialize();
                }
                else
                {
                    timeVector[n] = new IntervalButton(new Vector2(25, LevelMechanics.CalculateYPos(n)), timeVector[n - 1], null, timings[n]);
                    timeVector[n].Initialize();
                    timeVector[n - 1].SetNext(timeVector[n]);
                }
            }
        }
 public void SetNext(IntervalButton nextButton)
 {
     subsequent = nextButton;
 }