| | |
| | | } |
| | | |
| | | // 找到最后一个 turnCorner 动作的下标 |
| | | int turnCornerIdx = findLastActionIndex(actionList, turnCorner); |
| | | //int turnCornerIdx = findLastActionIndex(actionList, turnCorner); |
| | | int turnCornerIdx = findFirstActionIndex(actionList, turnCorner); |
| | | |
| | | // 根据是否找到 turnCorner 来选择不同的重新排序逻辑 |
| | | if (turnCornerIdx == -1) { |
| | |
| | | /** |
| | | * 在 actionList 中找到第一个指定 actionType 的下标 |
| | | */ |
| | | private int findFirstActionIndex(List<Action> actionList, long actionType) { |
| | | public int findFirstActionIndex(List<Action> actionList, long actionType) { |
| | | for (int i = 0; i < actionList.size(); i++) { |
| | | if (actionList.get(i).getActionType().equals(actionType)) { |
| | | return i; |
| | |
| | | /** |
| | | * 在 actionList 中找到最后一个指定 actionType 的下标 |
| | | */ |
| | | private int findLastActionIndex(List<Action> actionList, long actionType) { |
| | | public int findLastActionIndex(List<Action> actionList, long actionType) { |
| | | int index = -1; |
| | | for (int i = 0; i < actionList.size(); i++) { |
| | | if (actionList.get(i).getActionType().equals(actionType)) { |