extend_chapter.go 315 B

123456789101112131415
  1. package data
  2. // 获取第一章配置
  3. func (p *chapterConfig) GetFirstChapter() (*ChapterRow, bool) {
  4. if len(p.list) <= 0 {
  5. return nil, false
  6. }
  7. return p.list[0], true
  8. }
  9. // 验证关卡是否正确
  10. func (p *ChapterRow) VaildateLevel(levelID int32) bool {
  11. return p.StartID <= levelID && levelID <= p.EndID
  12. }