All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
feat(fight): 添加效果工厂模式支持以解决闭包变量捕获问题 - 新增initskillFactory函数用于注册效果工厂 - 修改技能效果注册逻辑从直接实例化改为工厂模式 - 解决循环中闭包捕获变量导致的潜在问题 feat(fight): 实现对手输入获取逻辑优化回合处理 - 添加roundOpponentInput方法获取对手输入 - 重构enterturn方法中的先后手逻辑 - 确保攻击方和被攻击
41 lines
906 B
Go
41 lines
906 B
Go
package model
|
|
|
|
import (
|
|
"blazing/cool"
|
|
"blazing/cool/coolconfig"
|
|
)
|
|
|
|
const TableNameServerList = "server_list"
|
|
|
|
// 服务器设置天气地图|地图是否显示其他人,设置异色概率|ip
|
|
// ServerList mapped from table <server_list>
|
|
type ServerList struct {
|
|
*cool.Model
|
|
coolconfig.ServerList
|
|
ServerShow *ServerShow `orm:"with:server_id=online_id" gorm:"-" json:"servershow,omitempty"`
|
|
// isonline
|
|
IsOnline uint8 `gorm:"column:isonline;default:0;comment:'是否在线'" json:"isonline"`
|
|
}
|
|
|
|
// TableName ServerList's table name
|
|
func (*ServerList) TableName() string {
|
|
return TableNameServerList
|
|
}
|
|
|
|
// GroupName ServerList's table group
|
|
func (*ServerList) GroupName() string {
|
|
return "default"
|
|
}
|
|
|
|
// NewServerList create a new ServerList
|
|
func NewServerList() *ServerList {
|
|
return &ServerList{
|
|
Model: cool.NewModel(),
|
|
}
|
|
}
|
|
|
|
// init 创建表
|
|
func init() {
|
|
cool.CreateTable(&ServerList{})
|
|
}
|