UiDynamicContentDatabase.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #pragma once
  9. #include <AzCore/Math/Color.h>
  10. #include <AzCore/JSON/document.h>
  11. #include <AzCore/std/string/string.h>
  12. #include <LyShineExamples/UiDynamicContentDatabaseBus.h>
  13. namespace LyShineExamples
  14. {
  15. class UiDynamicContentDatabase
  16. : protected UiDynamicContentDatabaseBus::Handler
  17. {
  18. public: // member functions
  19. UiDynamicContentDatabase();
  20. ~UiDynamicContentDatabase();
  21. // UiDynamicContentDatabaseBus interface implementation
  22. int GetNumColors(ColorType colorType) override;
  23. AZ::Color GetColor(ColorType colorType, int index) override;
  24. AZStd::string GetColorName(ColorType colorType, int index) override;
  25. AZStd::string GetColorPrice(ColorType colorType, int index) override;
  26. void Refresh(ColorType colorType, const AZStd::string& filePath) override;
  27. // ~UiDynamicContentDatabaseBus
  28. public: // static member functions
  29. static void Reflect(AZ::ReflectContext* context);
  30. private: // member functions
  31. AZ_DISABLE_COPY_MOVE(UiDynamicContentDatabase);
  32. private: // data
  33. rapidjson::Document m_document[UiDynamicContentDatabaseInterface::ColorType::NumColorTypes];
  34. bool m_documentParsed[UiDynamicContentDatabaseInterface::ColorType::NumColorTypes];
  35. };
  36. } // namespace LYGame