Blame view

ios/Runner/Wowgame/Classes/game_animal/AniSimpleValue.h 1.84 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
  //
  //  AniSimpleValue.h
  //  SteveMaggieCpp
  //
  //  Created by Katarzyna Kalinowska-Górska on 01.06.2017.
  //
  //
  
  #ifndef AniSimpleValue_h
  #define AniSimpleValue_h
  
  #include "AniScenarioObject.h"
  #include "cocos2d.h"
  #include <stdio.h>
  #include <string>
  
  //TODO getType
  class AniSimpleValue : public AniScenarioObject, public cocos2d::Ref
  {
      public:
      
          AniSimpleValue(const AniSimpleValue& val){
              _stringValue = val._stringValue;
              _numberValue = val._numberValue;
              _boolValue = val._boolValue;
              _pointValue = val._pointValue;
          };
      
          AniSimpleValue(std::string stringValue) {
             _stringValue = stringValue;
          };
      
          AniSimpleValue(float number){
             _numberValue = number;
          };
      
          AniSimpleValue(bool boolValue){
             _boolValue = boolValue;
          };
      
          AniSimpleValue(cocos2d::Point point){
             _pointValue = point;
          };
      
          virtual std::string getPropertyAsString(std::string propertyName = ""){
              if(propertyName == ""){
                  return _stringValue;
              }
              return "NULL";
          };
      
          float getNumberValue(){
              return _numberValue;
          }
      
          bool getBoolValue(){
              return _boolValue;
          }
      
          cocos2d::Point getPointValue(){
              return _pointValue;
          }
  
          std::string getStringValue(){
              return _stringValue;
          }
      
          void setBoolValue(bool pBoolValue){
              _boolValue = pBoolValue;
          }
      
          void setNumberValue(float pNumberValue){
              _numberValue = pNumberValue;
          }
      
      protected:
          std::string _stringValue;
          float _numberValue;
          cocos2d::Point _pointValue;
          bool _boolValue;
  };
  
  #endif /* SimpleString_h */