VirtualGamepadModule.cpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. #include <AzCore/Memory/SystemAllocator.h>
  9. #include "VirtualGamepadButtonComponent.h"
  10. #include "VirtualGamepadSystemComponent.h"
  11. #include "VirtualGamepadThumbStickComponent.h"
  12. #include <IGem.h>
  13. namespace VirtualGamepad
  14. {
  15. class VirtualGamepadModule
  16. : public CryHooksModule
  17. {
  18. public:
  19. AZ_RTTI(VirtualGamepadModule, "{0454CF83-A35E-443B-A9BE-858EBE9C908F}", CryHooksModule);
  20. AZ_CLASS_ALLOCATOR(VirtualGamepadModule, AZ::SystemAllocator);
  21. VirtualGamepadModule()
  22. : CryHooksModule()
  23. {
  24. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  25. m_descriptors.insert(m_descriptors.end(), {
  26. VirtualGamepadSystemComponent::CreateDescriptor(),
  27. VirtualGamepadButtonComponent::CreateDescriptor(),
  28. VirtualGamepadThumbStickComponent::CreateDescriptor(),
  29. });
  30. }
  31. /**
  32. * Add required SystemComponents to the SystemEntity.
  33. */
  34. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  35. {
  36. return AZ::ComponentTypeList{
  37. azrtti_typeid<VirtualGamepadSystemComponent>(),
  38. };
  39. }
  40. };
  41. }
  42. #if defined(O3DE_GEM_NAME)
  43. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME), VirtualGamepad::VirtualGamepadModule)
  44. #else
  45. AZ_DECLARE_MODULE_CLASS(Gem_VirtualGamepad, VirtualGamepad::VirtualGamepadModule)
  46. #endif