// Code generated by excel export. DO NOT EDIT. package data import ( "f1-game/internal/enum" ) var ChatMsgTemplate = &chatMsgTemplateConfig{} func init() { _allList = append(_allList, ChatMsgTemplate) } type ( ChatMsgTemplateRow struct { ChatMsgType enum.ChatMsgType `json:"ChatMsgType"` // 消息类型 } chatMsgTemplateConfig struct { baseConfig list []*ChatMsgTemplateRow // all list chatMsgTypeUniMaps map[enum.ChatMsgType]*ChatMsgTemplateRow // key:chatMsgType } ) func (p *chatMsgTemplateConfig) Name() string { return "chat_msg_template" } func (p *chatMsgTemplateConfig) Init() { p.chatMsgTypeUniMaps = map[enum.ChatMsgType]*ChatMsgTemplateRow{} } func (p *chatMsgTemplateConfig) OnLoad(maps interface{}, reload bool) (int, error) { if reload && p.denyLoad { return 0, nil } var list []*ChatMsgTemplateRow if err := DecodeData(maps, &list); err != nil { return 0, err } p.list = list chatMsgTypeUniMaps := map[enum.ChatMsgType]*ChatMsgTemplateRow{} for _, row := range list { chatMsgTypeUniMaps[row.ChatMsgType] = row } p.chatMsgTypeUniMaps = chatMsgTypeUniMaps return len(list), nil } // func (p *chatMsgTemplateConfig) OnAfterLoad(_ bool) { // } func (p *chatMsgTemplateConfig) List() []*ChatMsgTemplateRow { return p.list } func (p *chatMsgTemplateConfig) GetByChatMsgType(chatMsgType enum.ChatMsgType) (*ChatMsgTemplateRow, bool) { value, found := p.chatMsgTypeUniMaps[chatMsgType] return value, found } func (p *chatMsgTemplateConfig) ContainChatMsgType(chatMsgType enum.ChatMsgType) bool { _, found := p.chatMsgTypeUniMaps[chatMsgType] return found }