SampleComponentConfig.cpp 972 B

12345678910111213141516171819202122232425262728293031323334
  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 <SampleComponentConfig.h>
  9. #include <AzCore/Serialization/SerializeContext.h>
  10. namespace AtomSampleViewer
  11. {
  12. void SampleComponentConfig::Reflect(AZ::ReflectContext* context)
  13. {
  14. if (auto* serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
  15. {
  16. serializeContext->Class<SampleComponentConfig, AZ::ComponentConfig>()
  17. ->Version(1)
  18. ;
  19. }
  20. }
  21. bool SampleComponentConfig::IsValid() const
  22. {
  23. bool valid = true;
  24. valid &= m_windowContext.get() != nullptr;
  25. valid &= m_cameraEntityId != AZ::EntityId(AZ::EntityId::InvalidEntityId);
  26. valid &= !m_entityContextId.IsNull();
  27. return valid;
  28. }
  29. } // namespace AtomSampleViewer