${Name}Module.cpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // {BEGIN_LICENSE}
  2. /*
  3. * Copyright (c) Contributors to the Open 3D Engine Project.
  4. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. *
  6. * SPDX-License-Identifier: Apache-2.0 OR MIT
  7. *
  8. */
  9. // {END_LICENSE}
  10. #include <AzCore/Memory/SystemAllocator.h>
  11. #include <AzCore/Module/Module.h>
  12. #include "${Name}SystemComponent.h"
  13. #include <${Name}/${Name}TypeIds.h>
  14. namespace ${SanitizedCppName}
  15. {
  16. class ${SanitizedCppName}Module
  17. : public AZ::Module
  18. {
  19. public:
  20. AZ_RTTI(${SanitizedCppName}Module, ${SanitizedCppName}ModuleTypeId, AZ::Module);
  21. AZ_CLASS_ALLOCATOR(${SanitizedCppName}Module, AZ::SystemAllocator);
  22. ${SanitizedCppName}Module()
  23. : AZ::Module()
  24. {
  25. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  26. m_descriptors.insert(m_descriptors.end(), {
  27. ${SanitizedCppName}SystemComponent::CreateDescriptor(),
  28. });
  29. }
  30. /**
  31. * Add required SystemComponents to the SystemEntity.
  32. */
  33. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  34. {
  35. return AZ::ComponentTypeList{
  36. azrtti_typeid<${SanitizedCppName}SystemComponent>(),
  37. };
  38. }
  39. };
  40. }// namespace ${SanitizedCppName}
  41. #if defined(O3DE_GEM_NAME)
  42. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME), ${SanitizedCppName}::${SanitizedCppName}Module)
  43. #else
  44. AZ_DECLARE_MODULE_CLASS(Gem_${SanitizedCppName}, ${SanitizedCppName}::${SanitizedCppName}Module)
  45. #endif