PopupUIDataConfig.ts 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. export class PopupUIDataConfig {
  2. private _uiName: string = null;
  3. private _typeImg: string = null;
  4. private _typeMoney: string = null;
  5. private _label_1: string = null;
  6. private _label_2: string = null;
  7. private _label_3: string = null;
  8. private _consume: string = null;
  9. private _funcYes: any = null;
  10. //可用军队卡槽数量
  11. private _availableCardSlot: number = 4;
  12. private static _instance: PopupUIDataConfig = null;
  13. private constructor() { };
  14. static get Instance(): PopupUIDataConfig {
  15. if (!this._instance) {
  16. this._instance = new PopupUIDataConfig();
  17. } return this._instance;
  18. }
  19. clearDt() {
  20. this._uiName = null;
  21. this._typeImg = null;
  22. this._typeMoney = null;
  23. this._label_1 = null;
  24. this._label_2 = null;
  25. this._label_3 = null;
  26. this._consume = null;
  27. this._funcYes = null;
  28. }
  29. getUIName(): string { return this._uiName };
  30. getTypeImg(): string { return this._typeImg };
  31. getTypeMoney(): string { return this._typeMoney };
  32. getLabel() {
  33. const label = [this._label_1, this._label_2, this._label_3, this._consume]
  34. return label;
  35. }
  36. getFunction(): Function {
  37. return this._funcYes;
  38. }
  39. getAvailableCardSlot(): number{
  40. return this._availableCardSlot;
  41. }
  42. setUIName(name: string) { this._uiName = name };
  43. setTypeImg(name: string) { this._typeImg = name };
  44. setTypeMoney(name: string) { this._typeMoney = name };
  45. setLabel(label_1: string, label_2: string, label_3: string, consume: string) {
  46. this._label_1 = label_1;
  47. this._label_2 = label_2;
  48. this._label_3 = label_3;
  49. this._consume = consume;
  50. }
  51. setFunction(func: any) {
  52. this._funcYes = func;
  53. }
  54. setAvailableCardSlot(nextCount: number){
  55. this._availableCardSlot = nextCount;
  56. }
  57. }