CustomPropertyModel.h 802 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // CustomPropertyModel.h
  3. // cocos2d
  4. //
  5. // Created by ZhengSong on 2022/7/21.
  6. //
  7. #ifndef CustomPropertyModel_h
  8. #define CustomPropertyModel_h
  9. #include "base/CCRef.h"
  10. #include "base/CCValue.h"
  11. #include <string>
  12. NS_CC_BEGIN
  13. class CustomPropertyModel : public Ref{
  14. public:
  15. virtual bool init();
  16. CustomPropertyModel();
  17. Value code();
  18. void decode(const Value&);
  19. bool isUseDefault();
  20. void setIsUseDefault(bool isUse);
  21. int getType();
  22. void setType(int type);
  23. const Value& getValue();
  24. void setValue(const Value& value);
  25. const std::string& getName();
  26. void setName(const std::string& name);
  27. private:
  28. bool _isUseDefault; // 默认为true
  29. int _type;
  30. Value _value;
  31. std::string _name;
  32. };
  33. NS_CC_END
  34. #endif /* CustomPropertyModel_h */