GraphModelModule.cpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. #if defined(GRAPHMODEL_EDITOR)
  11. #include <GraphModelSystemComponent.h>
  12. #endif
  13. namespace GraphModel
  14. {
  15. class GraphModelModule
  16. : public AZ::Module
  17. {
  18. public:
  19. AZ_RTTI(GraphModelModule, "{217B9E5D-C0FC-4D9D-AD75-AA3B23566A96}", AZ::Module);
  20. AZ_CLASS_ALLOCATOR(GraphModelModule, AZ::SystemAllocator);
  21. GraphModelModule()
  22. : AZ::Module()
  23. {
  24. m_descriptors.insert(m_descriptors.end(), {
  25. #if defined(GRAPHMODEL_EDITOR)
  26. GraphModelSystemComponent::CreateDescriptor(),
  27. #endif
  28. });
  29. }
  30. /**
  31. * Add required SystemComponents to the SystemEntity.
  32. */
  33. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  34. {
  35. return AZ::ComponentTypeList{
  36. #if defined(GRAPHMODEL_EDITOR)
  37. azrtti_typeid<GraphModelSystemComponent>(),
  38. #endif
  39. };
  40. }
  41. };
  42. }
  43. #if defined(O3DE_GEM_NAME)
  44. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME), GraphModel::GraphModelModule)
  45. #else
  46. AZ_DECLARE_MODULE_CLASS(Gem_GraphModel, GraphModel::GraphModelModule)
  47. #endif