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); }
protected override void Shrink() { LinkedListNode <Tail>[] lastNodes = SnakeUtils.GetLastNodes(TailList, IsShrinking); for (int i = 0; i < lastNodes.Length; i++) { SLTail tail = (SLTail)lastNodes[i].Value; tail.TailImage.Visibility = Visibility.Collapsed; } base.Shrink(); }
void MainRenderLoop(object sender, EventArgs e) { try { snakeSL.SnakeImage.SetValue(Canvas.TopProperty, snakeSL.Pos.Y + level1SL.SnakeOffsetY); snakeSL.SnakeImage.SetValue(Canvas.LeftProperty, snakeSL.Pos.X); foreach (Tail tail in snakeSL.TailList) { SLTail ntail = (SLTail)tail; ntail.TailImage.SetValue(Canvas.TopProperty, ntail.Pos.Y + level1SL.SnakeOffsetY); ntail.TailImage.SetValue(Canvas.LeftProperty, ntail.Pos.X); } } catch (Exception) { //should never happen - if it does, no heck of an idea what to do... Perhaps reload the page? Presenter.MessageText = "Ein neuer Fehler traf auf :( "; } }
protected override void AddTail(Tail tail_DC) { SLTail tail = tail_DC as SLTail; base.AddTail(tail); }