Esempio n. 1
0
    public IntersectionGraphicsType GetGraphicsType()
    {
        switch (builder.GetIntersectionType(this))
        {
        case IntersectionBuilder.IntersectionType.NONE:
            return(IntersectionGraphicsType.NONE);

        case IntersectionBuilder.IntersectionType.ONE_WAY:
            return(IntersectionGraphicsType.ONE_WAY_WRAP);

        case IntersectionBuilder.IntersectionType.TWO_WAY:
            switch (builder.GetTwoWayIntersectionType(this))
            {
            case IntersectionBuilder.TwoWayIntersectionType.SKEW:
                return(IntersectionGraphicsType.TWO_WAY_SKEW);

            case IntersectionBuilder.TwoWayIntersectionType.SMOOTH:
                return(IntersectionGraphicsType.TWO_WAY_SMOOTH);

            case IntersectionBuilder.TwoWayIntersectionType.TRANSITION:
                return(IntersectionGraphicsType.TWO_WAY_TRANSITION);

            default:
                throw new ArgumentOutOfRangeException();
            }
            break;

        case IntersectionBuilder.IntersectionType.MULTI_WAY:
            return(IntersectionGraphicsType.MULTI_WAY);

        default:
            throw new ArgumentOutOfRangeException();
        }
    }
Esempio n. 2
0
    private bool shouldBuildAllWayStopSign(Intersection intersection)
    {
        switch (intersectionBuilder.GetIntersectionType(intersection))
        {
        case IntersectionBuilder.IntersectionType.NONE:
        case IntersectionBuilder.IntersectionType.ONE_WAY:
            return(false);

        case IntersectionBuilder.IntersectionType.MULTI_WAY:
            return(true);

        case IntersectionBuilder.IntersectionType.TWO_WAY:
            switch (intersectionBuilder.GetTwoWayIntersectionType(intersection))
            {
            case IntersectionBuilder.TwoWayIntersectionType.SKEW:
            case IntersectionBuilder.TwoWayIntersectionType.TRANSITION:
                return(true);

            case IntersectionBuilder.TwoWayIntersectionType.SMOOTH:
                return(false);
            }

            break;
        }

        throw new InvalidOperationException();
    }