${Name}ModuleInterface.cpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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}ModuleInterface.h"
  11. #include <AzCore/Memory/Memory.h>
  12. #include <${Name}/${Name}TypeIds.h>
  13. #include <Clients/${Name}SystemComponent.h>
  14. namespace ${SanitizedCppName}
  15. {
  16. AZ_TYPE_INFO_WITH_NAME_IMPL(${SanitizedCppName}ModuleInterface,
  17. "${SanitizedCppName}ModuleInterface", ${SanitizedCppName}ModuleInterfaceTypeId);
  18. AZ_RTTI_NO_TYPE_INFO_IMPL(${SanitizedCppName}ModuleInterface, AZ::Module);
  19. AZ_CLASS_ALLOCATOR_IMPL(${SanitizedCppName}ModuleInterface, AZ::SystemAllocator);
  20. ${SanitizedCppName}ModuleInterface::${SanitizedCppName}ModuleInterface()
  21. {
  22. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  23. // Add ALL components descriptors associated with this gem to m_descriptors.
  24. // This will associate the AzTypeInfo information for the components with the the SerializeContext, BehaviorContext and EditContext.
  25. // This happens through the [MyComponent]::Reflect() function.
  26. m_descriptors.insert(m_descriptors.end(), {
  27. ${SanitizedCppName}SystemComponent::CreateDescriptor(),
  28. });
  29. }
  30. AZ::ComponentTypeList ${SanitizedCppName}ModuleInterface::GetRequiredSystemComponents() const
  31. {
  32. return AZ::ComponentTypeList{
  33. azrtti_typeid<${SanitizedCppName}SystemComponent>(),
  34. };
  35. }
  36. } // namespace ${SanitizedCppName}