MaestroSystemComponent.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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/std/smart_ptr/unique_ptr.h>
  10. #include <AzCore/Component/Component.h>
  11. #include <CrySystemBus.h>
  12. #include "Cinematics/Movie.h"
  13. #include "Maestro/MaestroBus.h"
  14. namespace Maestro
  15. {
  16. class MaestroAllocatorComponent
  17. : public AZ::Component
  18. {
  19. public:
  20. AZ_COMPONENT(MaestroAllocatorComponent, "{3636E0F4-5208-450F-83F4-BE09F6EE7FBC}", AZ::Component);
  21. static void Reflect(AZ::ReflectContext* context);
  22. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  23. MaestroAllocatorComponent() = default;
  24. ~MaestroAllocatorComponent() override = default;
  25. void Activate() override;
  26. void Deactivate() override;
  27. };
  28. //////////////////////////////////////////////////////////////////////////
  29. class MaestroSystemComponent
  30. : public AZ::Component
  31. , protected MaestroRequestBus::Handler
  32. , protected CrySystemEventBus::Handler
  33. {
  34. public:
  35. AZ_COMPONENT(MaestroSystemComponent, "{47991994-4417-4CD7-AE0B-FEF1C8720766}");
  36. MaestroSystemComponent() = default;
  37. // The MaestroSystemComponent is a singleton, so should never by copied.
  38. MaestroSystemComponent(const MaestroSystemComponent&) = delete;
  39. static void Reflect(AZ::ReflectContext* context);
  40. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  41. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  42. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  43. static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
  44. protected:
  45. ////////////////////////////////////////////////////////////////////////
  46. // MaestroRequestBus interface implementation
  47. ////////////////////////////////////////////////////////////////////////
  48. // CrySystemEventBus ///////////////////////////////////////////////////////
  49. void OnCrySystemInitialized(ISystem& system, const SSystemInitParams&) override;
  50. virtual void OnCrySystemShutdown(ISystem&) override;
  51. ////////////////////////////////////////////////////////////////////////////
  52. ////////////////////////////////////////////////////////////////////////
  53. // AZ::Component interface implementation
  54. void Init() override;
  55. void Activate() override;
  56. void Deactivate() override;
  57. ////////////////////////////////////////////////////////////////////////
  58. private:
  59. // singletons representing the movie system
  60. AZStd::unique_ptr<CMovieSystem> m_movieSystem;
  61. };
  62. }