| | |
| | | lastDirection = nextDirection; |
| | | } |
| | | |
| | | // 如果当前地码和下一个地码都在站点地码集合内,则根据在集合中的顺序决定行进方向和是否倒退 |
| | | if (turnCodes.contains(lastCode.getData()) && turnCodes.contains(nextCode.getData())) { |
| | | int lastIndex = turnCodes.indexOf(lastCode.getData()); |
| | | int nextIndex = turnCodes.indexOf(nextCode.getData()); |
| | | if (nextIndex > lastIndex) { |
| | | nextDirection = 180D; |
| | | reverse = false; |
| | | } else if (nextIndex < lastIndex) { |
| | | nextDirection = 0D; |
| | | reverse = true; |
| | | } |
| | | } |
| | | |
| | | // run |
| | | ActionTypeType actionType = ActionTypeType.StraightAheadTurnable; |
| | | if (reverse) { |