Blame view

ios/Runner/Wowgame/Classes/game_animal/AniParentalGateShowInterface.h 1.29 KB
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
  //
  //  AniParentalGateShowInterface.h
  //  HalloweenSpaceInvaders
  //
  //  Created by Katarzyna Kalinowska-Górska on 14/10/2019.
  //
  
  #ifndef AniParentalGateShowInterface_h
  #define AniParentalGateShowInterface_h
  
  #include "AniParentalGateView.h"
  #include "cocos2d.h"
  
  class AniParentalGateShowInterface {
  
  public:
      bool isShowingParentalGate(){return _isPresentingParentalGate;};
      virtual void presentParentalGate(std::function<void()> onSuccessCallback, std::function<void()> onFailureCallback);
      virtual void hideParentalGate();
      virtual void PGSI_addChild(cocos2d::Node* n) {
          auto selfNode = dynamic_cast<cocos2d::Node*>(this);
          if(selfNode != nullptr){
              selfNode->addChild(n);
          }
      }
      virtual cocos2d::Node* PGSI_getChildByTag(int t) {
          auto selfNode = dynamic_cast<cocos2d::Node*>(this);
          if(selfNode != nullptr){
              return selfNode->getChildByTag(t);
          }
          return nullptr;
      }
      virtual cocos2d::EventDispatcher* PGSI_getEventDispatcher(){
          auto selfNode = dynamic_cast<cocos2d::Node*>(this);
          if(selfNode != nullptr){
              return selfNode->getEventDispatcher();
          }
          return nullptr;
      }
      
  protected:
      bool _isPresentingParentalGate;
  
  };
      
  #endif /* AniParentalGateShowInterface_h */