package com.qiuguo.iot.base.enums;

/*
* 动作类型
* 作者：吴林
* */
// 动作类型：0：文本播放 1音频播放 2 U3D动作 3物联网设备动作
public enum AskTypeEnum {
    TTS(0, "文本播放"),
    IOT(1, "IOT控制"),
    ALARM_CLOCK(3, "闹钟"),
    WEATHER(2, "天气"),

    U3D(4, "U3D动作"),
    MUSIC(5, "音乐，声音"),

    UPDATE(100, "固件升级"),
    ;
     AskTypeEnum(Integer c, String n){
        code = c;
        name = n;
    }
    private Integer code;
    private String name;

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static AskTypeEnum getEnumWithCode(Integer c){
        for (AskTypeEnum e:values()
        ) {
            if(e.getCode().compareTo(c) == 0){
                return e;
            }
        }
        return null;
    }
    public static AskTypeEnum getEnumWithName(String name){
        for (AskTypeEnum e:values()
        ) {
            if(e.getName().equals(name)){
                return e;
            }
        }
        return null;
    }
}
