ArchiveModuleInterface.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 "ArchiveModuleInterface.h"
  9. #include <AzCore/Memory/Memory.h>
  10. #include <Archive/ArchiveTypeIds.h>
  11. #include <Clients/ArchiveReaderFactory.h>
  12. #include <Clients/ArchiveSystemComponent.h>
  13. namespace Archive
  14. {
  15. AZ_TYPE_INFO_WITH_NAME_IMPL(ArchiveModuleInterface,
  16. "ArchiveModuleInterface", ArchiveModuleInterfaceTypeId);
  17. AZ_RTTI_NO_TYPE_INFO_IMPL(ArchiveModuleInterface, AZ::Module);
  18. AZ_CLASS_ALLOCATOR_IMPL(ArchiveModuleInterface, AZ::SystemAllocator);
  19. ArchiveModuleInterface::ArchiveModuleInterface()
  20. {
  21. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  22. // Add ALL components descriptors associated with this gem to m_descriptors.
  23. // This will associate the AzTypeInfo information for the components with the the SerializeContext, BehaviorContext and EditContext.
  24. // This happens through the [MyComponent]::Reflect() function.
  25. m_descriptors.insert(m_descriptors.end(), {
  26. ArchiveSystemComponent::CreateDescriptor(),
  27. });
  28. m_archiveReaderFactory = AZStd::make_unique<ArchiveReaderFactory>();
  29. ArchiveReaderFactoryInterface::Register(m_archiveReaderFactory.get());
  30. }
  31. ArchiveModuleInterface::~ArchiveModuleInterface()
  32. {
  33. ArchiveReaderFactoryInterface::Unregister(m_archiveReaderFactory.get());
  34. }
  35. AZ::ComponentTypeList ArchiveModuleInterface::GetRequiredSystemComponents() const
  36. {
  37. return AZ::ComponentTypeList{
  38. azrtti_typeid<ArchiveSystemComponent>(),
  39. };
  40. }
  41. } // namespace Archive