${Name}Module.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 <${Name}/${Name}TypeIds.h>
  11. #include <${Name}ModuleInterface.h>
  12. #include "${Name}SystemComponent.h"
  13. #include <AzCore/RTTI/RTTI.h>
  14. #include <Components/${Name}Component.h>
  15. namespace ${SanitizedCppName}
  16. {
  17. class ${SanitizedCppName}Module
  18. : public ${SanitizedCppName}ModuleInterface
  19. {
  20. public:
  21. AZ_RTTI(${SanitizedCppName}Module, ${SanitizedCppName}ModuleTypeId, ${SanitizedCppName}ModuleInterface);
  22. AZ_CLASS_ALLOCATOR(${SanitizedCppName}Module, AZ::SystemAllocator);
  23. ${SanitizedCppName}Module()
  24. {
  25. m_descriptors.insert(m_descriptors.end(),
  26. {
  27. ${SanitizedCppName}SystemComponent::CreateDescriptor(),
  28. ${SanitizedCppName}Component::CreateDescriptor(),
  29. });
  30. }
  31. AZ::ComponentTypeList GetRequiredSystemComponents() const
  32. {
  33. return AZ::ComponentTypeList{ azrtti_typeid<${SanitizedCppName}SystemComponent>() };
  34. }
  35. };
  36. }// namespace ${SanitizedCppName}
  37. #if defined(O3DE_GEM_NAME)
  38. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME), ${SanitizedCppName}::${SanitizedCppName}Module)
  39. #else
  40. AZ_DECLARE_MODULE_CLASS(Gem_${SanitizedCppName}, ${SanitizedCppName}::${SanitizedCppName}Module)
  41. #endif