package com.yuchen.saas.park.api.enums.property;

import lombok.Getter;

/**
 * 朝向类型
 */
@Getter
public enum TowardTypeEnum {
    SOUTH(1, "朝南"),
    NORTH(2, "朝北"),
    WEST(3, "朝西"),
    EAST(4, "朝东"),
    EAST_SOUTH(5, "东南"),
    WEST_SOUTH(6, "西南"),
    EAST_NORTH(7, "东北"),
    WEST_NORTH(8, "西北"),
    ;

    private Integer value;
    private String desc;
    TowardTypeEnum(int i, String desc) {
        value = i;
        this.desc=desc;
    }

    public boolean compare(int i){return value == i;}
    public static TowardTypeEnum convert(int intValue) {
        TowardTypeEnum[] allValues = TowardTypeEnum.values();
        for(int i = 0; i < allValues.length; i++) {
            if(allValues[i].compare(intValue))
                return allValues[i];
        }
        return null;
    }
}
