public virtual void OnShrinkingEvent(SnakeEventArgs e) { if (ShrinkingEvent != null) { ShrinkingEvent(this, e); } }
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); } }
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); }
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); } }
private void ChangedSpeed(object sender, SnakeEventArgs e) { dt.Interval = new TimeSpan(0, 0, 0, 0, e.Value); }
public virtual void OnShrinking(object sender, SnakeEventArgs e) { IsShrinking = e.Value; }