예제 #1
0
        Image GetEndCapImage(EndCapKind endCapKind)
        {
            switch (endCapKind)
            {
            case EndCapKind.Left:
                return(endCap_Left);

            case EndCapKind.Right:
                return(endCap_Right);

            case EndCapKind.Bottom:
                return(endCap_Bottom);

            case EndCapKind.Top:
                return(endCap_Top);

            case EndCapKind.LeftTee:
                return(tee_Left);

            case EndCapKind.RightTee:
                return(tee_Right);

            case EndCapKind.BottomTee:
                return(tee_Bottom);

            case EndCapKind.TopTee:
                return(tee_Top);

            case EndCapKind.BottomLeftCorner:
                return(corner_BottomLeft);

            case EndCapKind.BottomRightCorner:
                return(corner_BottomRight);

            case EndCapKind.TopRightCorner:
                return(corner_TopRight);

            case EndCapKind.TopLeftCorner:
                return(corner_TopLeft);

            case EndCapKind.FourWayIntersection:
                return(fourWayIntersection);
            }
            return(null);
        }
예제 #2
0
        private void DrawCap(Map map, int column, int row, Layer endCapLayer)
        {
            EndCapKind endCapKind = map.GetEndCapKind(column, row);

            if (endCapKind == EndCapKind.None)
            {
                return;
            }

            if (alreadyDrewEndCap[column + 1, row + 1])
            {
                return;
            }

            Image capImage = GetEndCapImage(endCapKind);

            DrawCap(column, row, endCapLayer, capImage);
            alreadyDrewEndCap[column + 1, row + 1] = true;
        }