Exemple #1
0
def baseRoad(request):
    _ = Road()
    print('\n')
    try:
        lengths = request.param
    except AttributeError:
        lengths = []
    for length in lengths:
        _.addSegment(Segment(length))
        print('adding segment with length {}'.format(length))
    print('road created')
    return _
Exemple #2
0
def basicRoad():
    r = Road()
    r.addSegment(Segment(100, theGear=Gear.DIRECT))
    r.addSegment(Segment(50, theGear=Gear.TURN))
    r.addSegment(Segment(100, theGear=Gear.DIRECT))
    r.addSegment(Segment(50, theGear=Gear.TURN))
    return r