Exemple #1
0
        public static Piece CreatePatternPiece(Piece bigPiece, int wSectionCount, int hSectionCount, int dSectionCount, int wsize, int dsize, int hsize, int w, int d, int h)
        {
            var piece = new Piece();
            piece.sizes[0] = wsize;
            piece.sizes[1] = dsize;
            piece.sizes[2] = hsize;

            if (w == 0)
                piece.faceColors[0] = bigPiece.faceColors[0];
            if (w == wSectionCount - 1)
                piece.faceColors[1] = bigPiece.faceColors[1];
            if (d == 0)
                piece.faceColors[2] = bigPiece.faceColors[2];
            if (d == dSectionCount - 1)
                piece.faceColors[3] = bigPiece.faceColors[3];
            if (h == 0)
                piece.faceColors[4] = bigPiece.faceColors[4];
            if (h == hSectionCount - 1)
                piece.faceColors[5] = bigPiece.faceColors[5];

            piece.doubleDotCount = piece.DoubleDotCount();
            piece.sizeSum = piece.sizes.Sum();

            return piece;
        }