Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
        public override void BadInput_Duplicate_Failed()
        {
            IGame gameBad = new MemoryLimitGame(0, 1, 2, 1);

            Assert.Fail();
        }
Exemplo n.º 4
0
        public override void BadInput_MoreArgument_Failed()
        {
            IGame gameBad = new MemoryLimitGame(0, 1, 2, 3, 4);

            Assert.Fail();
        }
Exemplo n.º 5
0
 private MemoryLimitGame(MemoryLimitGame originalGame, int tile)
 {
     this.game    = originalGame.game;
     this.changes = new LinkedList <int>(originalGame.changes);
     this.changes.AddLast(tile);
 }