using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using QURO; using System.ComponentModel; namespace SpriteMapEditor.SpriteMapModifications { class RemoveSprite : ISpriteMapModification { private readonly BindingList allSprites; private readonly int index; private readonly Sprite removedSprite; private List preChangeSelection; private List postChangeSelection; public RemoveSprite(BindingList spriteList, int indexToRemove) { allSprites = spriteList; index = indexToRemove; removedSprite = allSprites[index]; } public void Do() { allSprites.RemoveAt(index); } public void Undo() { allSprites.Insert(index, removedSprite); } public List GetPreChangeSelection() { return preChangeSelection; } public void SetPreChangeSelection(List currentSelection) { preChangeSelection = currentSelection; } public List GetPostChangeSelection() { return postChangeSelection; } public void SetPostChangeSelection(List currentSelection) { postChangeSelection = currentSelection; } public override string ToString() { return "Remove Sprite"; } } }