// Path: BiliLiveLib/src/main/java/charlie/bililivelib/danmaku/datamodel/WelcomeVipInfo.java
// @Data
// @AllArgsConstructor
// public class WelcomeVipInfo {
//     private String username;
//     private boolean admin;
// 
//     public WelcomeVipInfo(JsonObject rootObject) {
//         JsonObject dataObject = rootObject.get("data").getAsJsonObject();
// 
//         username = dataObject.get("uname").getAsString();
//         admin = dataObject.get("is_admin").getAsBoolean();
//     }
// }
// 
// Path: BiliLiveLib/src/main/java/charlie/bililivelib/danmaku/event/DanmakuEvent.java
// @Getter
// public class DanmakuEvent extends EventObject {
//     private Kind kind;
//     private Object param;
// 
//     /**
//      * Constructs a prototypical Event.
//      *
//      * @param source The object on which the Event initially occurred.
//      * @throws IllegalArgumentException if source is null.
//      */
//     public DanmakuEvent(Object source) {
//         super(source);
//     }
// 
//     public DanmakuEvent(Object source, Object param, Kind kind) {
//         super(source);
//         this.kind = kind;
//         this.param = param;
//     }
// 
//     public enum Kind {
//         JOINED, ERROR, ERROR_DOWN, NEW_DANMAKU, WATCHER_COUNT,
//         START_STOP, WELCOME_VIP, GIVE_GIFT, GLOBAL_GIFT, GLOBAL_ANNOUNCE
//     }
// }
// 
// Path: BiliLiveLib/src/main/java/charlie/bililivelib/danmaku/event/DanmakuListener.java
// public interface DanmakuListener {
//     void danmakuEvent(@NotNull DanmakuEvent event);
// 
//     void watcherCountEvent(@NotNull DanmakuEvent event);
// 
//     void errorEvent(@NotNull DanmakuEvent event);
// 
//     void startStopEvent(@NotNull DanmakuEvent event);
// 
//     void statusEvent(@NotNull DanmakuEvent event);
// 
//     void welcomeVipEvent(@NotNull DanmakuEvent event);
// 
//     void giveGiftEvent(@NotNull DanmakuEvent event);
// 
//     void globalGiftEvent(@NotNull DanmakuEvent event);
// 
//     void globalAnnounceEvent(@NotNull DanmakuEvent event);
// }


import charlie.bililivelib.danmaku.datamodel.WelcomeVipInfo;
import charlie.bililivelib.danmaku.event.DanmakuEvent;
import charlie.bililivelib.danmaku.event.DanmakuListener;
import com.google.gson.JsonObject;
import org.jetbrains.annotations.NotNull;
import java.util.List;
package charlie.bililivelib.danmaku.dispatch;



/**
 * 分发老爷进直播间事件的分发器。对COMMAND为'WELCOME'的事件有效。
 *
 * @author Charlie Jiang
 * @since rv1
 */
public class WelcomeVipDispatcher extends AbstractJSONDispatcher {
    public static final String[] ACCEPTABLE_COMMANDS = {
            "WELCOME"
    };
    private static WelcomeVipDispatcher GLOBAL_INSTANCE;

    @NotNull
    public static WelcomeVipDispatcher getGlobalInstance() {
        if (GLOBAL_INSTANCE == null) {
            GLOBAL_INSTANCE = new WelcomeVipDispatcher();
        }
        return GLOBAL_INSTANCE;
    }

    @Override
    protected String[] getAcceptableCommands() {
        return ACCEPTABLE_COMMANDS;
    }

    /**
     * {@inheritDoc}
     * @param listeners 监听器列表
     * @param rootObject 事件内容产生的JSON对象结构
     * @param source 事件发生源
     */
    @Override
    public void dispatch(List<DanmakuListener> listeners, JsonObject rootObject, Object source) {
        DanmakuEvent event = new DanmakuEvent(source, new WelcomeVipInfo(rootObject),
                DanmakuEvent.Kind.WELCOME_VIP);
// Path: BiliLiveLib/src/main/java/charlie/bililivelib/danmaku/datamodel/WelcomeVipInfo.java
// @Data
// @AllArgsConstructor
// public class WelcomeVipInfo {
//     private String username;
//     private boolean admin;
// 
//     public WelcomeVipInfo(JsonObject rootObject) {
//         JsonObject dataObject = rootObject.get("data").getAsJsonObject();
// 
//         username = dataObject.get("uname").getAsString();
//         admin = dataObject.get("is_admin").getAsBoolean();
//     }
// }
// 
// Path: BiliLiveLib/src/main/java/charlie/bililivelib/danmaku/event/DanmakuEvent.java
// @Getter
// public class DanmakuEvent extends EventObject {
//     private Kind kind;
//     private Object param;
// 
//     /**
//      * Constructs a prototypical Event.
//      *
//      * @param source The object on which the Event initially occurred.
//      * @throws IllegalArgumentException if source is null.
//      */
//     public DanmakuEvent(Object source) {
//         super(source);
//     }
// 
//     public DanmakuEvent(Object source, Object param, Kind kind) {
//         super(source);
//         this.kind = kind;
//         this.param = param;
//     }
// 
//     public enum Kind {
//         JOINED, ERROR, ERROR_DOWN, NEW_DANMAKU, WATCHER_COUNT,
//         START_STOP, WELCOME_VIP, GIVE_GIFT, GLOBAL_GIFT, GLOBAL_ANNOUNCE
//     }
// }
// 
// Path: BiliLiveLib/src/main/java/charlie/bililivelib/danmaku/event/DanmakuListener.java
// public interface DanmakuListener {
//     void danmakuEvent(@NotNull DanmakuEvent event);
// 
//     void watcherCountEvent(@NotNull DanmakuEvent event);
// 
//     void errorEvent(@NotNull DanmakuEvent event);
// 
//     void startStopEvent(@NotNull DanmakuEvent event);
// 
//     void statusEvent(@NotNull DanmakuEvent event);
// 
//     void welcomeVipEvent(@NotNull DanmakuEvent event);
// 
//     void giveGiftEvent(@NotNull DanmakuEvent event);
// 
//     void globalGiftEvent(@NotNull DanmakuEvent event);
// 
//     void globalAnnounceEvent(@NotNull DanmakuEvent event);
// }


// Path: BiliLiveLib/src/main/java/charlie/bililivelib/danmaku/dispatch/WelcomeVipDispatcher.java
import charlie.bililivelib.danmaku.datamodel.WelcomeVipInfo;
import charlie.bililivelib.danmaku.event.DanmakuEvent;
import charlie.bililivelib.danmaku.event.DanmakuListener;
import com.google.gson.JsonObject;
import org.jetbrains.annotations.NotNull;
import java.util.List;

package charlie.bililivelib.danmaku.dispatch;



/**
 * 分发老爷进直播间事件的分发器。对COMMAND为'WELCOME'的事件有效。
 *
 * @author Charlie Jiang
 * @since rv1
 */
public class WelcomeVipDispatcher extends AbstractJSONDispatcher {
    public static final String[] ACCEPTABLE_COMMANDS = {
            "WELCOME"
    };
    private static WelcomeVipDispatcher GLOBAL_INSTANCE;

    @NotNull
    public static WelcomeVipDispatcher getGlobalInstance() {
        if (GLOBAL_INSTANCE == null) {
            GLOBAL_INSTANCE = new WelcomeVipDispatcher();
        }
        return GLOBAL_INSTANCE;
    }

    @Override
    protected String[] getAcceptableCommands() {
        return ACCEPTABLE_COMMANDS;
    }

    /**
     * {@inheritDoc}
     * @param listeners 监听器列表
     * @param rootObject 事件内容产生的JSON对象结构
     * @param source 事件发生源
     */
    @Override
    public void dispatch(List<DanmakuListener> listeners, JsonObject rootObject, Object source) {
        DanmakuEvent event = new DanmakuEvent(source, new WelcomeVipInfo(rootObject),
                DanmakuEvent.Kind.WELCOME_VIP);
        for (DanmakuListener listener : listeners) {