| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- // Code generated by excel export. DO NOT EDIT.
- package data
- var Gm = &gmConfig{}
- func init() {
- _allList = append(_allList, Gm)
- }
- type (
- GmRow struct {
- GmID int32 `json:"GmID"` // 命令ID
- Gm string `json:"Gm"` // 命令
- }
- gmConfig struct {
- baseConfig
- list []*GmRow // all list
- gmIDUniMaps map[int32]*GmRow // key:gmID
- }
- )
- func (p *gmConfig) Name() string {
- return "gm"
- }
- func (p *gmConfig) Init() {
- p.gmIDUniMaps = map[int32]*GmRow{}
- }
- func (p *gmConfig) OnLoad(maps interface{}, reload bool) (int, error) {
- if reload && p.denyLoad {
- return 0, nil
- }
- var list []*GmRow
- if err := DecodeData(maps, &list); err != nil {
- return 0, err
- }
- p.list = list
- gmIDUniMaps := map[int32]*GmRow{}
- for _, row := range list {
- gmIDUniMaps[row.GmID] = row
- }
- p.gmIDUniMaps = gmIDUniMaps
- return len(list), nil
- }
- // func (p *gmConfig) OnAfterLoad(_ bool) {
- // }
- func (p *gmConfig) List() []*GmRow {
- return p.list
- }
- func (p *gmConfig) GetByGmID(gmID int32) (*GmRow, bool) {
- value, found := p.gmIDUniMaps[gmID]
- return value, found
- }
- func (p *gmConfig) ContainGmID(gmID int32) bool {
- _, found := p.gmIDUniMaps[gmID]
- return found
- }
|