Пример #1
0
 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;
 }
Пример #2
0
        public void RemoveCurrent()
        {
            var cur = this.Current;

            Items.Remove(cur);

            var ix = this.Index.Value;

            Index = new CyclingInteger(0, Items.Count);
            Index = Index + ix;
        }
Пример #3
0
        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;
        }
Пример #4
0
 public void AddRange(IEnumerable <T> items)
 {
     Items.AddRange(items);
     Index = new CyclingInteger(0, Items.Count);
 }
Пример #5
0
 public void AddItem(T item)
 {
     Items.Add(item);
     Index = new CyclingInteger(0, Items.Count);
 }