package cn.iocoder.yudao.module.system.enums.path;

import cn.iocoder.yudao.module.system.enums.robot.RobotTaskTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

/**
 * 下发路径规划的任务类型
 */
@Getter
@AllArgsConstructor
public enum PathTaskTypeEnum {
    TAKE_RELEASE("TAKE_RELEASE","取放货任务"),
    CHARGE("CHARGE","充电任务"),
    MOVE("MOVE","移动任务(移动到库位)"),
    MOVE_TO_WAIT("MOVE_TO_WAIT","移动到等待点(没任务时去等待点)"),
    MOVE_TO_WAIT_STOP("MOVE_TO_WAIT_STOP","停车任务"),
    MOVE_TO_POINT("MOVE_TO_POINT","移动到路径点任务"),
    MOVE_TO_PP_POINT("MOVE_TO_PP_POINT","移动到路径规划指定的点位"),
    TAKE("TAKE","仅取货任务"),
    RELEASE("RELEASE","仅放货任务"),
    AUTO_CHARGE("AUTO_CHARGE","自动充电");
    /**
     * 类型
     */
    private final String type;

    private final String msg;

    /**
     * 仅设计个别类型
     * @param taskType
     * @return
     */
    public static String getTaskType(Integer taskType) {
        if (RobotTaskTypeEnum.TAKE_RELEASE.getType().equals(taskType)) {
            return TAKE_RELEASE.getType();
        }else if (RobotTaskTypeEnum.CHARGE.getType().equals(taskType)) {
            return CHARGE.getType();
        }else if (RobotTaskTypeEnum.MOVE.getType().equals(taskType)) {
            return MOVE.getType();
        }else if (RobotTaskTypeEnum.TAKE.getType().equals(taskType)) {
            return TAKE.getType();
        }else if (RobotTaskTypeEnum.RELEASE.getType().equals(taskType)) {
            return RELEASE.getType();
        }else if (RobotTaskTypeEnum.PARK.getType().equals(taskType)) {
            return MOVE_TO_WAIT_STOP.getType();
        }else if (RobotTaskTypeEnum.MOVE_TO_POINT.getType().equals(taskType)) {
            return MOVE_TO_POINT.getType();
        }else {
            return AUTO_CHARGE.getType();
        }
    }

    /**
     * 获取非任务的类型
     * @return
     */
    public static List<String> getMistakeTaskTypes() {
        List<String> list = new ArrayList<>();
        list.add(MOVE_TO_WAIT.getType());
        list.add(AUTO_CHARGE.getType());
        return list;
    }
}
