public Animation(IRemoveable root, IWithPosition parent, Sprite sprite, params int[] frames) { Root = root; Parent = parent; TimePerFrame = new ConfigValue <TimeSpan>("animation frame"); Sprite = sprite; Frames = frames; CurrentFrameIndex = new CyclingInteger(frames.Length); DrawInfo = sprite.DrawInfo; }
public void RemoveCurrent() { var cur = this.Current; Items.Remove(cur); var ix = this.Index.Value; Index = new CyclingInteger(0, Items.Count); Index = Index + ix; }
public void AddOption(TItem option) { bool wasVisible = this.Visible; var newOption = new MenuOption <TItem>(option, this); Options.Add(newOption); SelectedOption = new CyclingInteger(Options.Count); MenuPanel.AddItem(newOption); this.Visible = wasVisible; }
public void AddRange(IEnumerable <T> items) { Items.AddRange(items); Index = new CyclingInteger(0, Items.Count); }
public void AddItem(T item) { Items.Add(item); Index = new CyclingInteger(0, Items.Count); }