GlobalClubInfo.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. CGlobalClubInfo = cc.Class({
  2. ctor:function(){
  3. this._ClubInfoList = {};
  4. this._ClubInfoList.length = 0;
  5. },
  6. onClear:function(){
  7. this._ClubInfoList = {};
  8. this._ClubInfoList.length = 0;
  9. },
  10. onInsertClubInfo:function(clubInfo){
  11. if(clubInfo == null) return;
  12. if(this._ClubInfoList[`${clubInfo.dwClubID}`]){
  13. this.onUpdateClubInfo(clubInfo);
  14. return;
  15. }
  16. !this._ClubInfoList[`${clubInfo.dwClubID}`] && this._ClubInfoList.length++;
  17. this._ClubInfoList[`${clubInfo.dwClubID}`] = clubInfo;
  18. },
  19. onDeleteClubInfo:function(dwClubID){
  20. if(this._ClubInfoList[`${dwClubID}`] == null) return;
  21. this._ClubInfoList.length--;
  22. delete this._ClubInfoList[`${dwClubID}`];
  23. },
  24. onUpdateClubInfo:function(clubInfo){
  25. this._ClubInfoList[`${clubInfo.dwClubID}`] && clubInfo && gCByte.StrSameMemCopy(this._ClubInfoList[`${clubInfo.dwClubID}`],clubInfo);
  26. },
  27. onUpdateClubLevel:function(dwClubID,cbClubLevel){
  28. if(this._ClubInfoList[`${dwClubID}`]){
  29. this._ClubInfoList[`${dwClubID}`].cbClubLevel = cbClubLevel;
  30. }
  31. },
  32. onUpdateClubScore:function(dwClubID,lScore){
  33. if(this._ClubInfoList[`${dwClubID}`]){
  34. this._ClubInfoList[`${dwClubID}`].llScore = lScore;
  35. }
  36. },
  37. //更新桌子数量 0+ 1-
  38. onUpdateClubTableCnt:function(dwClubID,type){
  39. if(this._ClubInfoList[`${dwClubID}`]){
  40. type == 1 && this._ClubInfoList[`${dwClubID}`].wTableCount--;
  41. type == 0 && this._ClubInfoList[`${dwClubID}`].wTableCount++;
  42. }
  43. },
  44. onGetClubInfo:function(dwClubID){
  45. return this._ClubInfoList[`${dwClubID}`];
  46. },
  47. onGetClubRules:function(dwClubID){
  48. if(this._ClubInfoList[`${dwClubID}`] == null) return 0;
  49. return this._ClubInfoList[`${dwClubID}`].dwRules;
  50. },
  51. onGetClubInfoList:function(){
  52. return this._ClubInfoList;
  53. },
  54. onModifyClubInfo:function(Obj){
  55. if(this._ClubInfoList[`${Obj.dwClubID}`] == null) return;
  56. this._ClubInfoList[`${Obj.dwClubID}`].szClubName = Obj.szClubName;
  57. this._ClubInfoList[`${Obj.dwClubID}`].cbJoinLimit = Obj.cbJoinLimit;
  58. this._ClubInfoList[`${Obj.dwClubID}`].dwRules = Obj.dwRules;
  59. this._ClubInfoList[`${Obj.dwClubID}`].szNotice = Obj.szNotice;
  60. this._ClubInfoList[`${Obj.dwClubID}`].szNotice2 = Obj.szNotice2;
  61. this._ClubInfoList[`${Obj.dwClubID}`].cbCloseStatus= Obj.cbCloseStatus;
  62. }
  63. });
  64. g_GlobalClubInfo = new CGlobalClubInfo();