PrefabTestData.cpp 886 B

123456789101112131415161718192021222324252627282930
  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 <Prefab/PrefabTestData.h>
  9. namespace UnitTest
  10. {
  11. InstanceData::InstanceData(const InstanceData& other)
  12. : m_name(other.m_name)
  13. , m_source(other.m_source)
  14. {
  15. m_patches.CopyFrom(other.m_patches, m_patches.GetAllocator());
  16. }
  17. InstanceData& InstanceData::InstanceData::operator=(
  18. const InstanceData& other)
  19. {
  20. m_name = other.m_name;
  21. m_source = other.m_source;
  22. // copyfrom does not free existing memory, so force this to occur:
  23. m_patches = AzToolsFramework::Prefab::PrefabDom();
  24. m_patches.CopyFrom(other.m_patches, m_patches.GetAllocator());
  25. return *this;
  26. }
  27. }