IAPSucessProcess.hpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //
  2. // CtlSucessProcess.hpp
  3. // TileManor
  4. //
  5. // Created by 徐炼新 on 2024/1/25.
  6. //
  7. #ifndef IAPSucessProcess_hpp
  8. #define IAPSucessProcess_hpp
  9. #include <stdio.h>
  10. #include "cocos2d.h"
  11. #include "RUReboltLayer.h"
  12. #include "RUTableView.h"
  13. #include "IAPConf.hpp"
  14. class IAPCtlShopItem;
  15. class IAPSucessProcess : public cocos2d::Ref
  16. {
  17. public:
  18. // 在指定节点内创建
  19. static IAPSucessProcess* create(const GoodsInfo& gi);
  20. void setCBWhileFinished(std::function<void()> cb) { _cbWhileFinished = cb; }
  21. private:
  22. typedef struct _ndReward {
  23. Node* light = nullptr;
  24. Node* reward = nullptr;
  25. Node* lbCnt = nullptr;
  26. _ndReward() {
  27. light = nullptr;
  28. reward = nullptr;
  29. lbCnt = nullptr;
  30. }
  31. } NdReward;
  32. IAPSucessProcess();
  33. ~IAPSucessProcess();
  34. void init(const GoodsInfo& gi);
  35. void acceptItems();
  36. void acceptItem(NdReward& nr, cocos2d::Node* tar, float delay, const ItemInGoods&, std::function<void(const ItemInGoods&)> finished);
  37. void onNotifyDevelopment(const redutils::ReboltNotifyData& data);
  38. void someCollected();
  39. private:
  40. void setRewardInfo();
  41. redutils::RUReboltLayer* _layer = nullptr;
  42. GoodsInfo _goodsInfo;
  43. std::vector<NdReward> _ndsReward;
  44. cocos2d::Node* _item_coin = nullptr;
  45. redream::ReboltRedManager* _reboltMgr4Coin = nullptr;
  46. int _cntCollecting = 0;
  47. std::function<void()> _cbWhileFinished = nullptr;
  48. };
  49. #endif /* CtlSucessProcess_hpp */