public void TestUndoThrowsExcpOnEmpty() { var hk = new HistoryKeeper <int>(0); Assert.Throws <EmptyHistoryException>(() => hk.GoBack()); hk.Do(4); hk.GoBack(); Assert.Throws <EmptyHistoryException>(() => hk.GoBack()); }
public void TestRedoClearsOnDo() { var hk = new HistoryKeeper <int>(0); hk.Do(4); hk.Do(4); hk.GoBack(); hk.Do(5); Assert.Throws <EmptyHistoryException>(() => hk.GoForward()); }
public void TestUndoNormal() { var hk = new HistoryKeeper <int>(0); hk.Do(4); Assert.AreEqual(0, hk.GoBack()); hk.Do(1); hk.Do(2); hk.Do(3); Assert.AreEqual(2, hk.GoBack()); Assert.AreEqual(1, hk.GoBack()); Assert.AreEqual(0, hk.GoBack()); }
public void TestRedoNormal() { var hk = new HistoryKeeper <int>(0); hk.Do(4); hk.GoBack(); Assert.AreEqual(4, hk.GoForward()); hk.Do(1); hk.Do(2); hk.Do(3); hk.GoBack(); hk.GoBack(); Assert.AreEqual(2, hk.GoForward()); Assert.AreEqual(3, hk.GoForward()); hk.GoBack(); Assert.AreEqual(3, hk.GoForward()); }
public HSREraseTile(HistoryKeeper parent, IntVector2 tileLocation) : base(parent) { location = tileLocation; var tileCheck = MapManager.singleton.GetTileAt(tileLocation); if (tileCheck != null) { //MapManager.BrushType oldType = tileCheck.GetComponent<TileListener>(). oldPrefab = MapManager.singleton.GetTilePrefabForType(MapManager.BrushType.TILE); //TODO: make this consider terrain types/ animated types etc. oldSwatch = tileCheck.GetComponent <TileListener>().swatchData; } else { oldPrefab = null; } }
public HSRDrawTile(HistoryKeeper parent, ColorPickerPopup.SwatchData swatch, IntVector2 tileLocation, GameObject prefab) : base(parent) { newSwatch = swatch; location = tileLocation; newPrefab = prefab; var tileCheck = MapManager.singleton.GetTileAt(tileLocation); if (tileCheck != null) { oldPrefab = newPrefab; //TODO: make this consider terrain types/ animated types etc. oldSwatch = tileCheck.GetComponent <TileListener>().swatchData; } else { oldPrefab = null; } }
public void TestRedoThrowsExcpOnEmpty() { var hk = new HistoryKeeper <int>(0); Assert.Throws <EmptyHistoryException>(() => hk.GoForward()); hk.Do(4); Assert.Throws <EmptyHistoryException>(() => hk.GoForward()); hk.GoBack(); hk.GoForward(); Assert.Throws <EmptyHistoryException>(() => hk.GoForward()); hk.Do(1); hk.Do(2); hk.Do(3); hk.GoBack(); hk.GoBack(); Assert.AreEqual(2, hk.GoForward()); Assert.AreEqual(3, hk.GoForward()); hk.GoBack(); Assert.AreEqual(3, hk.GoForward()); }
public FtpFileManager(Folder root, Ftp client) { Client = client; CurrentPath = root.Path; History = new HistoryKeeper <Folder>(root); }
public WinFileManager(Folder root) { CurrentPath = root.Path; History = new HistoryKeeper <Folder>(root); }
//public properties public HistoryStackRecord(HistoryKeeper parent) { historyKeeper = parent; }
public HSRBatchEnd(HistoryKeeper parent) : base(parent) { }
public HSRBatchBegin(HistoryKeeper parent) : base(parent) { }