AutomatedTestingSystemComponent.cpp 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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/Serialization/SerializeContext.h>
  9. #include <AzCore/Serialization/EditContext.h>
  10. #include <AzCore/Serialization/EditContextConstants.inl>
  11. #include <Source/AutoGen/AutoComponentTypes.h>
  12. #include <Multiplayer/IMultiplayer.h>
  13. #include <AzCore/Console/ILogger.h>
  14. #include <AutomatedTestingSystemComponent.h>
  15. #include <Multiplayer/ReplicationWindows/IReplicationWindow.h>
  16. namespace AutomatedTesting
  17. {
  18. void AutomatedTestingSystemComponent::Reflect(AZ::ReflectContext* context)
  19. {
  20. if (AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context))
  21. {
  22. serialize->Class<AutomatedTestingSystemComponent, AZ::Component>()
  23. ->Version(0)
  24. ;
  25. if (AZ::EditContext* ec = serialize->GetEditContext())
  26. {
  27. ec->Class<AutomatedTestingSystemComponent>("AutomatedTesting", "[Description of functionality provided by this System Component]")
  28. ->ClassElement(AZ::Edit::ClassElements::EditorData, "")
  29. ->Attribute(AZ::Edit::Attributes::AutoExpand, true)
  30. ;
  31. }
  32. }
  33. }
  34. void AutomatedTestingSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
  35. {
  36. provided.push_back(AZ_CRC_CE("AutomatedTestingService"));
  37. }
  38. void AutomatedTestingSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
  39. {
  40. incompatible.push_back(AZ_CRC_CE("AutomatedTestingService"));
  41. }
  42. void AutomatedTestingSystemComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required)
  43. {
  44. required.push_back(AZ_CRC_CE("MultiplayerService"));
  45. }
  46. void AutomatedTestingSystemComponent::GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent)
  47. {
  48. AZ_UNUSED(dependent);
  49. }
  50. void AutomatedTestingSystemComponent::Init()
  51. {
  52. }
  53. void AutomatedTestingSystemComponent::Activate()
  54. {
  55. AutomatedTestingRequestBus::Handler::BusConnect();
  56. RegisterMultiplayerComponents(); //< Register AutomatedTesting's multiplayer components to assign NetComponentIds
  57. }
  58. void AutomatedTestingSystemComponent::Deactivate()
  59. {
  60. AutomatedTestingRequestBus::Handler::BusDisconnect();
  61. }
  62. }