${Name}Module.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0 OR MIT
  5. *
  6. */
  7. #include <AzCore/Memory/SystemAllocator.h>
  8. #include <AzCore/Module/Module.h>
  9. #include <Components/ExampleFilteredEntityComponent.h>
  10. #include <Components//NetworkPrefabSpawnerComponent.h>
  11. #include <Source/AutoGen/AutoComponentTypes.h>
  12. #include "${SanitizedCppName}SystemComponent.h"
  13. namespace ${SanitizedCppName}
  14. {
  15. class ${SanitizedCppName}Module
  16. : public AZ::Module
  17. {
  18. public:
  19. AZ_RTTI(${SanitizedCppName}Module, "${ModuleClassId}", AZ::Module);
  20. AZ_CLASS_ALLOCATOR(${SanitizedCppName}Module, AZ::SystemAllocator, 0);
  21. ${SanitizedCppName}Module()
  22. : AZ::Module()
  23. {
  24. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  25. m_descriptors.insert(m_descriptors.end(), {
  26. ${SanitizedCppName}SystemComponent::CreateDescriptor(),
  27. ExampleFilteredEntityComponent::CreateDescriptor(),
  28. NetworkPrefabSpawnerComponent::CreateDescriptor(),
  29. });
  30. CreateComponentDescriptors(m_descriptors);
  31. }
  32. /**
  33. * Add required SystemComponents to the SystemEntity.
  34. */
  35. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  36. {
  37. return AZ::ComponentTypeList{
  38. azrtti_typeid<${SanitizedCppName}SystemComponent>(),
  39. };
  40. }
  41. };
  42. }
  43. // DO NOT MODIFY THIS LINE UNLESS YOU RENAME THE GEM
  44. // The first parameter should be GemName_GemIdLower
  45. // The second should be the fully qualified name of the class above
  46. #if defined(AZ_MONOLITHIC_BUILD)
  47. AZ_DECLARE_MODULE_CLASS(Gem_${SanitizedCppName}_Client, ${SanitizedCppName}::${SanitizedCppName}Module);
  48. AZ_DECLARE_MODULE_CLASS(Gem_${SanitizedCppName}_Server, ${SanitizedCppName}::${SanitizedCppName}Module);
  49. #endif
  50. AZ_DECLARE_MODULE_CLASS(Gem_${SanitizedCppName}, ${SanitizedCppName}::${SanitizedCppName}Module)