AWSGameLiftClientModule.cpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 <AzCore/Module/Module.h>
  10. #include <AWSGameLiftClientSystemComponent.h>
  11. #if defined(AWS_GAMELIFT_CLIENT_EDITOR)
  12. #include <AWSGameLiftClientEditorSystemComponent.h>
  13. #endif
  14. namespace AWSGameLift
  15. {
  16. //! Provide the entry point for the gem and register the system component.
  17. class AWSGameLiftClientModule
  18. : public AZ::Module
  19. {
  20. public:
  21. AZ_RTTI(AWSGameLiftClientModule, "{7b920f3e-2b23-482e-a1b6-16bd278d126c}", AZ::Module);
  22. AZ_CLASS_ALLOCATOR(AWSGameLiftClientModule, AZ::SystemAllocator);
  23. AWSGameLiftClientModule()
  24. : AZ::Module()
  25. {
  26. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  27. m_descriptors.insert(m_descriptors.end(),
  28. {
  29. #if defined(AWS_GAMELIFT_CLIENT_EDITOR)
  30. AWSGameLiftClientEditorSystemComponent::CreateDescriptor()
  31. #else
  32. AWSGameLiftClientSystemComponent::CreateDescriptor()
  33. #endif
  34. }
  35. );
  36. }
  37. /**
  38. * Add required SystemComponents to the SystemEntity.
  39. */
  40. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  41. {
  42. return AZ::ComponentTypeList
  43. {
  44. #if defined(AWS_GAMELIFT_CLIENT_EDITOR)
  45. azrtti_typeid<AWSGameLiftClientEditorSystemComponent>()
  46. #else
  47. azrtti_typeid<AWSGameLiftClientSystemComponent>()
  48. #endif
  49. };
  50. }
  51. };
  52. }// namespace AWSGameLift
  53. #if defined(O3DE_GEM_NAME)
  54. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME, _Clients), AWSGameLift::AWSGameLiftClientModule)
  55. #else
  56. AZ_DECLARE_MODULE_CLASS(Gem_AWSGameLift_Clients, AWSGameLift::AWSGameLiftClientModule)
  57. #endif