public void FadeInBattleForPos(int pos, int count) { this.FirstPos = pos; this.Count = count; Active = true; Mode = SideBarMode.BattleForPosition; SideBarTitle title = new SideBarTitle(); string t = "BATTLE FOR "; if (pos == 1) { t += "1st"; } else if (pos == 2) { t += " 2nd"; } else if (pos == 3) { t += " 3rd"; } else { t += pos.ToString("0") + "th"; } title.VerticalAlignment = VerticalAlignment.Top; LayoutRoot.Children.Add(title); elements.Add(title); title.FadeIn(t); if (module == null) { module = (LiveStandingsModule)TMTVO.Controller.TMTVO.Instance.Api.FindModule("LiveStandings"); } int j = 1; for (int i = pos; i < pos + count; i++) { LiveStandingsItem item = module.FindDriverByPos(i); if (item == null) { break; } BattleElement e = new BattleElement(this, module); e.VerticalAlignment = VerticalAlignment.Top; elements.Add(e); LayoutRoot.Children.Add(e); e.Margin = new Thickness(0, j * 36, 0, 0); e.FadeIn(item, j * 25); j++; } }
public void Tick() { if (Mode == SideBarMode.BattleForPosition) { int j = 1; for (int i = FirstPos; i < FirstPos + Count; i++) { BattleElement e = elements[j++] as BattleElement; e.Driver = module.FindDriverByPos(i); } } foreach (ISideBarElement e in elements) { e.Tick(); } }