package com.ltgk.common.enums;

/**
 * @Author: w1826
 * @Description: TODO
 * @Date: 2025/1/16 14:06
 * @Version: 1.0
 */
public enum FunctionArea {
    //1、大型船舶停靠区2、中型船舶停靠区3、小型船舶停靠区4、商船停靠区、5、高速航道6、中速航道7、低速航道
    LARGE_SHIP_DOCKING_AREA(1, "大型船舶停靠区"),
    MEDIUM_SHIP_DOCKING_AREA(2, "中型船舶停靠区"),
    SMALL_SHIP_DOCKING_AREA(3, "小型船舶停靠区"),
    COMMERCIAL_SHIP_DOCKING_AREA(4, "商船停靠区"),
    HIGH_SPEED_CHANNEL(5, "高速航道"),
    MEDIUM_SPEED_CHANNEL(6, "中速航道"),
    LOW_SPEED_CHANNEL(7, "低速航道");
    private final Integer code;
    private final String name;

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    FunctionArea(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static FunctionArea getFunctionArea(Integer code) {
        for (FunctionArea value : FunctionArea.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
