gameCfg.ts 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import ConfProxy, { ConfListProxy } from "./confProxy"
  2. import { XlsConfig, xlsAttrAttr, xlsAudioInfo, xlsChapterInfo, xlsChapterLayout, xlsEmitterInfo, xlsGuideInfo, xlsItemKind
  3. , xlsKaiqiInfo, xlsLanguageLang, xlsLanguageClientText, xlsLanguageSeverHouduan, xlsMathInfo, xlsMergePropInfo, xlsNameName, xlsPackageInfo, xlsPingbiciInfo
  4. } from "./xlsConfig"
  5. export default class Gamecfg {
  6. static attrAttr:ConfProxy<xlsAttrAttr>
  7. static audioInfo:ConfProxy<xlsAudioInfo>
  8. static chapterInfo:ConfProxy<xlsChapterInfo>
  9. static chapterLayoutList:ConfListProxy<xlsChapterLayout>
  10. static emitterInfo:ConfProxy<xlsEmitterInfo>
  11. static guideInfo:ConfProxy<xlsGuideInfo>
  12. static guideInfoList:ConfListProxy<xlsGuideInfo>
  13. static itemKind:ConfProxy<xlsItemKind>
  14. static kaiqiInfo:ConfProxy<xlsKaiqiInfo>
  15. static languageLang:ConfProxy<xlsLanguageLang>
  16. static languageClientText:ConfProxy<xlsLanguageClientText>
  17. static languageSeverHouduan:ConfProxy<xlsLanguageSeverHouduan>
  18. static mathInfo:ConfProxy<xlsMathInfo>
  19. static mergePropInfo:ConfProxy<xlsMergePropInfo>
  20. static nameName:ConfProxy<xlsNameName>
  21. static packageInfo:ConfProxy<xlsPackageInfo>
  22. static pingbiciInfo:ConfProxy<xlsPingbiciInfo>
  23. static initLoading(loadSuccess: Function) {
  24. try {
  25. new XlsConfig("loadJson",(xls: XlsConfig) => {
  26. Gamecfg.audioInfo = new ConfProxy("audioInfo",xls.xlsAudioInfo ,"id")
  27. Gamecfg.languageLang = new ConfProxy("languageLang",xls.xlsLanguageLang ,"key")
  28. Gamecfg.languageClientText = new ConfProxy("languageClientText",xls.xlsLanguageClientText ,"key")
  29. Gamecfg.mathInfo = new ConfProxy("mathInfo",xls.xlsMathInfo ,"key")
  30. Gamecfg.packageInfo = new ConfProxy("packageInfo",xls.xlsPackageInfo ,"id")
  31. loadSuccess(true)
  32. })
  33. } catch (error) {
  34. loadSuccess(false)
  35. }
  36. }
  37. static init(loadSuccess: Function, progressCallback: Function) {
  38. try {
  39. new XlsConfig("pzwj",(xls: XlsConfig) => {
  40. Gamecfg.attrAttr = new ConfProxy("attrAttr",xls.xlsAttrAttr ,"id")
  41. Gamecfg.chapterInfo = new ConfProxy("chapterInfo",xls.xlsChapterInfo ,"id")
  42. Gamecfg.chapterLayoutList = new ConfListProxy("chapterLayoutList",xls.xlsChapterLayout ,"infoId")
  43. Gamecfg.emitterInfo = new ConfProxy("emitterInfo",xls.xlsEmitterInfo ,"id")
  44. Gamecfg.guideInfo = new ConfProxy("guideInfo",xls.xlsGuideInfo ,"id")
  45. Gamecfg.guideInfoList = new ConfListProxy("guideInfoList",xls.xlsGuideInfo ,"event")
  46. Gamecfg.itemKind = new ConfProxy("itemKind",xls.xlsItemKind ,"kind")
  47. Gamecfg.kaiqiInfo = new ConfProxy("kaiqiInfo",xls.xlsKaiqiInfo ,"id")
  48. Gamecfg.languageSeverHouduan = new ConfProxy("languageSeverHouduan",xls.xlsLanguageSeverHouduan ,"key")
  49. Gamecfg.mergePropInfo = new ConfProxy("mergePropInfo",xls.xlsMergePropInfo ,"id")
  50. Gamecfg.nameName = new ConfProxy("nameName",xls.xlsNameName ,"frist")
  51. Gamecfg.pingbiciInfo = new ConfProxy("pingbiciInfo",xls.xlsPingbiciInfo ,"id")
  52. loadSuccess(true)
  53. }, progressCallback)
  54. } catch (error) {
  55. loadSuccess(false)
  56. }
  57. }
  58. }