| | |
| | | package com.zy.acs.manager.core.domain; |
| | | |
| | | import com.zy.acs.framework.common.Cools; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by vincent on 2023/6/19 |
| | |
| | | @Data |
| | | public class PathDto { |
| | | |
| | | private String codeData; |
| | | private String code; |
| | | |
| | | private int[] coordinate; |
| | | private Double direction; |
| | | |
| | | private boolean turn = false; |
| | | |
| | | public PathDto() { |
| | | } |
| | | |
| | | public PathDto(String codeData, int[] coordinate) { |
| | | this.codeData = codeData; |
| | | this.coordinate = coordinate; |
| | | public PathDto(String code, Double direction) { |
| | | this.code = code; |
| | | this.direction = direction; |
| | | } |
| | | |
| | | public PathDto(String code, Double direction, boolean turn) { |
| | | this.code = code; |
| | | this.direction = direction; |
| | | this.turn = turn; |
| | | } |
| | | |
| | | public static void markTurn(List<PathDto> pathTrace, Double direction) { |
| | | if (Cools.isEmpty(pathTrace) || direction == null) { |
| | | return; |
| | | } |
| | | PathDto current = pathTrace.get(pathTrace.size() - 1); |
| | | current.setDirection(direction); |
| | | current.setTurn(true); |
| | | } |
| | | |
| | | |
| | | } |