예제 #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);
        }
예제 #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);
 }
예제 #3
0
        public override void BadInput_Duplicate_Failed()
        {
            IGame gameBad = new MemoryLimitGame(0, 1, 2, 1);

            Assert.Fail();
        }
예제 #4
0
        public override void BadInput_MoreArgument_Failed()
        {
            IGame gameBad = new MemoryLimitGame(0, 1, 2, 3, 4);

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