Beispiel #1
0
        public void TestPlaceBufferedModuleTopRightBottomBuffers()
        {
            int[] before = new int[]
            {
                0, -1, 0, 0, 0,
                1, 1, 1, 1, 0,
                1, 1, 1, 1, 0,
                1, 1, 1, 1, -2,
                1, 1, 1, 1, 0,
                1, 1, 1, 1, 0,
                0, -3, 0, 0, 0,
            };

            int[] after = new int[]
            {
                0, -1, 0, 0, 0,
                1, 1, 1, 3, 0,
                -5, -5, -5, 3, 0,
                -5, -5, -5, 3, -2,
                -5, -5, -5, 3, 0,
                4, 4, 4, 4, 0,
                0, -3, 0, 0, 0,
            };

            RectangleTestTools.CompareBoardsAfterPlacement(before, after, 5, new TestModule(3, 3, 0));
        }
Beispiel #2
0
        public void TestPlaceBufferedModuleAllBuffer()
        {
            int[] before = new int[]
            {
                0, 0, 0, -1, 0, 0, 0,
                0, 1, 1, 1, 1, 1, 0,
                0, 1, 1, 1, 1, 1, 0,
                -4, 1, 1, 1, 1, 1, -2,
                0, 1, 1, 1, 1, 1, 0,
                0, 1, 1, 1, 1, 1, 0,
                0, 0, 0, -3, 0, 0, 0,
            };

            int[] after = new int[]
            {
                0, 0, 0, -1, 0, 0, 0,
                0, 1, 1, 1, 1, 3, 0,
                0, 2, -5, -5, -5, 3, 0,
                -4, 2, -5, -5, -5, 3, -2,
                0, 2, -5, -5, -5, 3, 0,
                0, 4, 4, 4, 4, 4, 0,
                0, 0, 0, -3, 0, 0, 0,
            };

            RectangleTestTools.CompareBoardsAfterPlacement(before, after, 7, new TestModule(3, 3, 0));
        }
Beispiel #3
0
        public void TestPlaceLotsOfMixerModules()
        {
            int[] before = new int[]
            {
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
            };

            int[] after = new int[]
            {
                -1, -1, -1, -1, -1, -1, -2, -2, -2, -2, -2, -2, 1,
                -1, -1, -1, -1, -1, -1, -2, -2, -2, -2, -2, -2, 1,
                -1, -1, -1, -1, -1, -1, -2, -2, -2, -2, -2, -2, 1,
                2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1,
                -3, -3, -3, -3, -3, -3, -4, -4, -4, -4, -4, -4, 1,
                -3, -3, -3, -3, -3, -3, -4, -4, -4, -4, -4, -4, 1,
                -3, -3, -3, -3, -3, -3, -4, -4, -4, -4, -4, -4, 1,
                -5, -5, -5, -5, -5, -5, -6, -6, -6, -6, -6, -6, 1,
                -5, -5, -5, -5, -5, -5, -6, -6, -6, -6, -6, -6, 1,
                -5, -5, -5, -5, -5, -5, -6, -6, -6, -6, -6, -6, 1,
                3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
                3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
                3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
                3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
                3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
                3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
                3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
                3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
            };

            var beforeBoardData = RectangleTestTools.ArrayToRectangles(before, 13);
            var afterBoardData  = RectangleTestTools.ArrayToRectangles(after, 13);

            beforeBoardData.board.FastTemplatePlace(new TestModule(6, 3, 0));
            beforeBoardData.board.FastTemplatePlace(new TestModule(6, 3, 0));
            beforeBoardData.board.FastTemplatePlace(new TestModule(6, 3, 0));
            beforeBoardData.board.FastTemplatePlace(new TestModule(6, 3, 0));
            beforeBoardData.board.FastTemplatePlace(new TestModule(6, 3, 0));
            beforeBoardData.board.FastTemplatePlace(new TestModule(6, 3, 0));

            RectangleTestTools.CompareBoards(beforeBoardData.board, afterBoardData.board);
        }
Beispiel #4
0
        public void TestPlaceBufferedModuleNoBuffer()
        {
            int[] before = new int[]
            {
                1, 1, 1, 1, 1,
                1, 1, 1, 1, 1,
                1, 1, 1, 1, 1,
                1, 1, 1, 1, 1,
            };

            int[] after = new int[]
            {
                -1, -1, -1, 1, 1,
                -1, -1, -1, 1, 1,
                -1, -1, -1, 1, 1,
                2, 2, 2, 1, 1,
            };

            RectangleTestTools.CompareBoardsAfterPlacement(before, after, 5, new TestModule(3, 3, 0));
        }