Negative values for PathElements are ignored in the calculation
Lists of PathElements are copied and their element are changed afterward. This leads to changes in the original lists.
This pull request fixes these bugs. The length in PathElements remains positive, but if the constructor gets a negative value for param it reverses the gear.
Furthermore I wrote some tests and did some refactorings, which hopefully improve code quality.
In Issue #2 two bugs have been reported:
PathElement
s are ignored in the calculationPathElement
s are copied and their element are changed afterward. This leads to changes in the original lists.This pull request fixes these bugs. The length in
PathElement
s remains positive, but if the constructor gets a negative value forparam
it reverses the gear.Furthermore I wrote some tests and did some refactorings, which hopefully improve code quality.