package api.common.pojo.enums;

import lombok.Getter;

import java.util.Objects;

@Getter
public enum MultiSimulationResultTypeEnum {

    INIT_TYPE(0, "未知类型"),
    COLLISION(1, "碰撞"),
    ABNORMAL_PARKING(2, "异常停车"),
    OUT_OF_PAVEMENT(3, "冲出车道"),
    LAST_DESCRIPTION(4, "最后描述");

    private Integer resultType;

    private String resultDetail;

    MultiSimulationResultTypeEnum(Integer resultType, String resultDetail) {
        this.resultType = resultType;
        this.resultDetail = resultDetail;
    }

    public static MultiSimulationResultTypeEnum matchStatusEnumByStatus(Integer resultType) {
        if (Objects.isNull(resultType)) {
            return null;
        }
        for (MultiSimulationResultTypeEnum enums : MultiSimulationResultTypeEnum.values()) {
            if (enums.getResultType().equals(resultType)){
                return enums;
            }
        }
        return null;
    }
}
