EventData.cpp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /******************************************************************************
  2. * Spine Runtimes License Agreement
  3. * Last updated January 1, 2020. Replaces all prior versions.
  4. *
  5. * Copyright (c) 2013-2020, Esoteric Software LLC
  6. *
  7. * Integration of the Spine Runtimes into software or otherwise creating
  8. * derivative works of the Spine Runtimes is permitted under the terms and
  9. * conditions of Section 2 of the Spine Editor License Agreement:
  10. * http://esotericsoftware.com/spine-editor-license
  11. *
  12. * Otherwise, it is permitted to integrate the Spine Runtimes into software
  13. * or otherwise create derivative works of the Spine Runtimes (collectively,
  14. * "Products"), provided that each user of the Products must obtain their own
  15. * Spine Editor license and redistribution of the Products in any form must
  16. * include this license and copyright notice.
  17. *
  18. * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
  19. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  20. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  21. * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
  22. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  23. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
  24. * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
  25. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  26. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  27. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. *****************************************************************************/
  29. #ifdef SPINE_UE4
  30. #include "SpinePluginPrivatePCH.h"
  31. #endif
  32. #include <spine/EventData.h>
  33. #include <assert.h>
  34. spine::EventData::EventData(const spine::String &name) :
  35. _name(name),
  36. _intValue(0),
  37. _floatValue(0),
  38. _stringValue(),
  39. _audioPath(),
  40. _volume(1),
  41. _balance(0) {
  42. assert(_name.length() > 0);
  43. }
  44. /// The name of the event, which is unique within the skeleton.
  45. const spine::String &spine::EventData::getName() const {
  46. return _name;
  47. }
  48. int spine::EventData::getIntValue() {
  49. return _intValue;
  50. }
  51. void spine::EventData::setIntValue(int inValue) {
  52. _intValue = inValue;
  53. }
  54. float spine::EventData::getFloatValue() {
  55. return _floatValue;
  56. }
  57. void spine::EventData::setFloatValue(float inValue) {
  58. _floatValue = inValue;
  59. }
  60. const spine::String &spine::EventData::getStringValue() {
  61. return _stringValue;
  62. }
  63. void spine::EventData::setStringValue(const spine::String &inValue) {
  64. this->_stringValue = inValue;
  65. }
  66. const spine::String &spine::EventData::getAudioPath() {
  67. return _audioPath;
  68. }
  69. void spine::EventData::setAudioPath(const spine::String &inValue) {
  70. _audioPath = inValue;
  71. }
  72. float spine::EventData::getVolume() {
  73. return _volume;
  74. }
  75. void spine::EventData::setVolume(float inValue) {
  76. _volume = inValue;
  77. }
  78. float spine::EventData::getBalance() {
  79. return _balance;
  80. }
  81. void spine::EventData::setBalance(float inValue) {
  82. _balance = inValue;
  83. }