Blame view

ios/Runner/Wowgame/Classes/game_toy/ToyRepeatedActionScheduler.h 1.22 KB
cb213901   xiaoyu   添加一个游戏的源码和编译选项
1
  //
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
2
  //  ToyRepeatedActionScheduler.h
cb213901   xiaoyu   添加一个游戏的源码和编译选项
3
4
5
6
7
8
  //  SteveMaggieCpp
  //
  //  Created by Katarzyna Kalinowska-Górska on 27.05.2017.
  //
  //
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
9
10
  #ifndef ToyRepeatedActionScheduler_h
  #define ToyRepeatedActionScheduler_h
cb213901   xiaoyu   添加一个游戏的源码和编译选项
11
12
13
14
15
16
17
18
19
  
  #include "json/document.h"
  #include <stdio.h>
  #include <string>
  #include "cocos2d.h"
  
  
  class ActionParseDelegate;
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
20
  class ToyRepeatedActionScheduler
cb213901   xiaoyu   添加一个游戏的源码和编译选项
21
22
23
24
25
26
27
28
29
30
  {
      public:
      
          struct ScheduledActionsData
          {
              std::string callbackKey;
              std::string storedValueKey;
              long long lastTimeRun;
          };
      
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
31
          static ToyRepeatedActionScheduler& getInstance()
cb213901   xiaoyu   添加一个游戏的源码和编译选项
32
          {
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
33
              static ToyRepeatedActionScheduler instance;
cb213901   xiaoyu   添加一个游戏的源码和编译选项
34
35
36
37
38
39
40
41
42
43
44
45
46
              return instance;
          };
      
          void clearAllScheduledActions(ActionParseDelegate* parseDelegate);
          cocos2d::Action* scheduleActionIfNeeded(const rapidjson::Value& jsonActionObject, ActionParseDelegate* parseDelegate, bool notifyDelegateWhenFinished);
          bool isActionValidRepeatedAction(const rapidjson::Value& jsonActionObject);
      
      protected:
      
          std::map<std::string, ScheduledActionsData> _scheduledActionsData;
          std::map<std::string, std::function<void(float)>> _waitingFunctions;
  };
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
47
  #endif /* ToyRepeatedActionScheduler_h */