refactor(player): 重构OgreInfo数据结构并优化怪物生成逻辑

- 将Player结构体中的OgreInfo字段从[9]OgrePetInfo数组改为OgrePet结构体
- 更新所有OgreInfo的访问方式,使用OgreInfo.Data[index]替代OgreInfo[index]
- 移除不再使用的common包
This commit is contained in:
2025-12-28 23:16:59 +08:00
parent 67227f3016
commit dee8193bde
3 changed files with 22 additions and 22 deletions

View File

@@ -45,7 +45,7 @@ type OgrePetInfo struct {
Ext uint32 `struc:"skip"` //是否变尼尔尼奥
}
func (o *OgrePetInfo) RandSHiny(t int64) {
func (o *OgrePetInfo) RandSHiny() {
// o.ShinyInfo = make([]data.GlowFilter, 1)
// // 假设 t 是包含 ShinyInfo 字段的结构体ShinyInfo 是 GlowFilter 类型的切片
// o.ShinyInfo[0] = data.GlowFilter{
@@ -90,7 +90,7 @@ type Player struct {
Fightinfo info.Fightinfo // 当前邀请的玩家ID
Logintime uint32 // 当前登录时间
OgreInfo [9]OgrePetInfo
OgreInfo OgrePet
Service *blservice.UserService
User *service.BaseSysUserService
@@ -101,6 +101,10 @@ type Player struct {
Canmon uint32 // 可以刷怪
}
type OgrePet struct {
Data [9]OgrePetInfo
}
// PlayerOption 定义配置 Player 的函数类型
type PlayerOption func(*Player)