Added SpriteMapModifications for use in Form1

This commit is contained in:
quinnvoker
2018-12-01 14:31:13 -08:00
parent d7fc242aa7
commit 92249cac8f
9 changed files with 299 additions and 1 deletions
@@ -0,0 +1,36 @@
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<SpriteMapRegion> allSprites;
private readonly int index;
private readonly SpriteMapRegion removedSprite;
public RemoveSprite(BindingList<SpriteMapRegion> spriteList, int indexToRemove)
{
allSprites = spriteList;
index = indexToRemove;
removedSprite = allSprites[index];
}
public void Do()
{
allSprites.RemoveAt(index);
}
public void Undo()
{
allSprites.Insert(index, removedSprite);
}
}
}