public override IGame Shift(int tile) { MemoryLimitGame dekor = new MemoryLimitGame(this, tile); foreach (var change in dekor.changes) { dekor.game.Shift(change); } for (var node = dekor.changes.Last; node != null; node = node.Previous) { dekor.game.Shift(node.Value); } return(dekor); }
public override void Initialize() { game = new MemoryLimitGame(0, 1, 2, 3); game3by3 = new MemoryLimitGame(0, 1, 2, 3, 4, 5, 6, 7, 8); game4by4 = new MemoryLimitGame(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); }
public override void BadInput_Duplicate_Failed() { IGame gameBad = new MemoryLimitGame(0, 1, 2, 1); Assert.Fail(); }
public override void BadInput_MoreArgument_Failed() { IGame gameBad = new MemoryLimitGame(0, 1, 2, 3, 4); Assert.Fail(); }
private MemoryLimitGame(MemoryLimitGame originalGame, int tile) { this.game = originalGame.game; this.changes = new LinkedList <int>(originalGame.changes); this.changes.AddLast(tile); }