package com.zanxiang.game.module.sdk.listener;

import com.zanxiang.game.module.mybatis.entity.GameUserRole;
import lombok.Getter;
import org.springframework.context.ApplicationEvent;

/**
 * @author : lingfeng
 * @time : 2024-06-05
 * @description : 游戏角色创建事件
 */
@Getter
public class GameRoleCreateEvent extends ApplicationEvent {

    /**
     * 玩家id
     */
    private Long userId;

    /**
     * 游戏id
     */
    private Long gameId;

    /**
     * 角色id
     */
    private String roleId;

    public GameRoleCreateEvent(Object source, GameUserRole userRole) {
        super(source);
        this.userId = userRole.getUserId();
        this.gameId = userRole.getGameId();
        this.roleId = userRole.getRoleId();
    }
}
