BoolTrack.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #ifndef CRYINCLUDE_CRYMOVIE_BOOLTRACK_H
  9. #define CRYINCLUDE_CRYMOVIE_BOOLTRACK_H
  10. #pragma once
  11. #include "IMovieSystem.h"
  12. #include "AnimTrack.h"
  13. //////////////////////////////////////////////////////////////////////////
  14. //////////////////////////////////////////////////////////////////////////
  15. /** Boolean track, every key on this track negates boolean value.
  16. */
  17. class CBoolTrack
  18. : public TAnimTrack<IBoolKey>
  19. {
  20. public:
  21. AZ_CLASS_ALLOCATOR(CBoolTrack, AZ::SystemAllocator);
  22. AZ_RTTI(CBoolTrack, "{A98E28CB-DE42-47A3-8E4B-6B43A5F3D8B2}", IAnimTrack);
  23. CBoolTrack();
  24. AnimValueType GetValueType() override;
  25. void GetValue(float time, bool& value) override;
  26. void SetValue(float time, const bool& value, bool bDefault = false) override;
  27. void SerializeKey([[maybe_unused]] IBoolKey& key, [[maybe_unused]] XmlNodeRef& keyNode, [[maybe_unused]] bool bLoading) override {};
  28. void GetKeyInfo(int key, const char*& description, float& duration) override;
  29. void SetDefaultValue(const bool bDefaultValue);
  30. bool Serialize(XmlNodeRef& xmlNode, bool bLoading, bool bLoadEmptyTracks = true) override;
  31. static void Reflect(AZ::ReflectContext* context);
  32. private:
  33. bool m_bDefaultValue;
  34. };
  35. #endif // CRYINCLUDE_CRYMOVIE_BOOLTRACK_H