AssetValidationModule.cpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 <AssetValidationSystemComponent.h>
  11. #ifdef EDITOR_MODULE
  12. #include <Editor/Source/EditorAssetValidationSystemComponent.h>
  13. #endif
  14. namespace AssetValidation
  15. {
  16. class AssetValidationModule
  17. : public AZ::Module
  18. {
  19. public:
  20. AZ_RTTI(AssetValidationModule, "{66A6C65D-7814-4CFF-AF54-B73925FD1188}", AZ::Module);
  21. AZ_CLASS_ALLOCATOR(AssetValidationModule, AZ::SystemAllocator);
  22. AssetValidationModule()
  23. : AZ::Module()
  24. {
  25. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  26. m_descriptors.insert(m_descriptors.end(), {
  27. AssetValidationSystemComponent::CreateDescriptor(),
  28. #ifdef EDITOR_MODULE
  29. EditorAssetValidationSystemComponent::CreateDescriptor(),
  30. #endif
  31. });
  32. }
  33. /**
  34. * Add required SystemComponents to the SystemEntity.
  35. */
  36. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  37. {
  38. return AZ::ComponentTypeList{
  39. azrtti_typeid<AssetValidationSystemComponent>(),
  40. #ifdef EDITOR_MODULE
  41. azrtti_typeid<EditorAssetValidationSystemComponent>(),
  42. #endif
  43. };
  44. }
  45. };
  46. }
  47. #if defined(O3DE_GEM_NAME)
  48. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME), AssetValidation::AssetValidationModule)
  49. #else
  50. AZ_DECLARE_MODULE_CLASS(Gem_AssetValidation, AssetValidation::AssetValidationModule)
  51. #endif