CCBKeyframe.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #include "editor-support/cocosbuilder/CCBKeyframe.h"
  2. using namespace cocos2d;
  3. namespace cocosbuilder {
  4. CCBKeyframe::CCBKeyframe()
  5. : _object(nullptr)
  6. , _time(0.0f)
  7. , _easingType(EasingType::INSTANT)
  8. , _easingOpt(0.0f)
  9. {}
  10. CCBKeyframe::~CCBKeyframe()
  11. {
  12. CC_SAFE_RELEASE(_object);
  13. }
  14. const Value& CCBKeyframe::getValue() const
  15. {
  16. return _value;
  17. }
  18. void CCBKeyframe::setValue(const Value& value)
  19. {
  20. _value = value;
  21. }
  22. Ref* CCBKeyframe::getObject() const
  23. {
  24. return _object;
  25. }
  26. void CCBKeyframe::setObject(Ref* obj)
  27. {
  28. CC_SAFE_RETAIN(obj);
  29. CC_SAFE_RELEASE(_object);
  30. _object = obj;
  31. }
  32. float CCBKeyframe::getTime()
  33. {
  34. return _time;
  35. }
  36. void CCBKeyframe::setTime(float fTime)
  37. {
  38. _time = fTime;
  39. }
  40. CCBKeyframe::EasingType CCBKeyframe::getEasingType()
  41. {
  42. return _easingType;
  43. }
  44. void CCBKeyframe::setEasingType(CCBKeyframe::EasingType easingType)
  45. {
  46. _easingType = easingType;
  47. }
  48. float CCBKeyframe::getEasingOpt()
  49. {
  50. return _easingOpt;
  51. }
  52. void CCBKeyframe::setEasingOpt(float fEasingOpt)
  53. {
  54. _easingOpt = fEasingOpt;
  55. }
  56. }