コード例 #1
0
 public virtual void OnShrinkingEvent(SnakeEventArgs e)
 {
     if (ShrinkingEvent != null)
     {
         ShrinkingEvent(this, e);
     }
 }
コード例 #2
0
        public virtual void OnInverseEvent(SnakeEventArgs e)
        {
            IsControlInversed     = true;
            inverseTimer.Interval = new TimeSpan(0, 0, 0, e.Time);
            inverseTimer.Tick    += new EventHandler(inverseTimer_Tick);
            inverseTimer.Start();

            if (InverseEvent != null)
            {
                InverseEvent(this, e);
            }
        }
コード例 #3
0
        public override void OnShrinking(object sender, SnakeEventArgs e)
        {
            LinkedListNode <Tail>[] lastNodes = SnakeUtils.GetLastNodes(TailList, e.Value);

            for (int i = 0; i < lastNodes.Length; i++)
            {
                SLTail tail = (SLTail)lastNodes[i].Value;
                tail.IsShrinking = true;
            }

            base.OnShrinking(sender, e);
        }
コード例 #4
0
        public virtual void OnChangedSpeed(SnakeEventArgs e)
        {
            speedTimer.Stop();
            if (e.Value != this.SnakeSpeed)
            {
                speedTimer.Interval = new TimeSpan(0, 0, 0, e.Time);
                speedTimer.Tick    += new EventHandler(speedTimer_Tick);
                speedTimer.Start();
            }

            if (ChangedSpeedEvent != null)
            {
                ChangedSpeedEvent(this, e);
            }
        }
コード例 #5
0
 private void ChangedSpeed(object sender, SnakeEventArgs e)
 {
     dt.Interval = new TimeSpan(0, 0, 0, 0, e.Value);
 }
コード例 #6
0
 public virtual void OnShrinking(object sender, SnakeEventArgs e)
 {
     IsShrinking = e.Value;
 }