package api.common.pojo.enums;

import lombok.Getter;

import java.util.Objects;

@Getter
public enum MultiSimulationStatusEnum {

    INIT_STATUS(0, "未开始"),
    RUN_STATUS(1, "运行中"),
    TERMINATED_STATUS(2, "已终止"),
    COMPLETED_STATUS(3, "已完成");

    private Integer projectStatus;

    private String projectStatusValue;

    MultiSimulationStatusEnum(Integer projectStatus, String projectStatusValue) {
        this.projectStatus = projectStatus;
        this.projectStatusValue = projectStatusValue;
    }

    public static MultiSimulationStatusEnum matchStatusEnumByStatus(Integer status) {
        if (Objects.isNull(status)) {
            return null;
        }
        for (MultiSimulationStatusEnum enums : MultiSimulationStatusEnum.values()) {
            if (enums.getProjectStatus().equals(status)){
                return enums;
            }
        }
        return null;
    }
}
