active.go 785 B

123456789101112131415161718192021222324252627282930
  1. package jsonload
  2. // 活动active表
  3. type ZoneActiveItem struct {
  4. IncreaseID int `json:"ID"`
  5. Name string `json:"Name"`
  6. ActiveTime []int `json:"timeInterval"` //活动时间
  7. FreeCount int `json:"OpenTimes"`
  8. BuysCost [][2]int64 `json:"OpenBuy"`
  9. ChapterID uint `json:"MapChapter"`
  10. Restrict []int `json:"Restrict"` // 限制掉落道具类型
  11. }
  12. // 加载活动
  13. func LoadZoneActive() []*ZoneActiveItem {
  14. filePath := "../serverjson/activity.json"
  15. var zoneActives []*ZoneActiveItem
  16. LoadJsonFile(filePath, &zoneActives)
  17. return zoneActives
  18. }
  19. // func (zai []*ZoneActiveItem) GetItem(id int) *jsonload.ZoneActiveItem {
  20. // for _, v := range zai.ZoneActives {
  21. // if v.IncreaseID == id {
  22. // return v
  23. // }
  24. // }
  25. // return nil
  26. // }