ROSConDemoSystemComponent.cpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #include "ROSConDemoSystemComponent.h"
  2. #include <AzCore/Serialization/EditContext.h>
  3. #include <AzCore/Serialization/EditContextConstants.inl>
  4. #include <AzCore/Serialization/SerializeContext.h>
  5. namespace ROSConDemo
  6. {
  7. void ROSConDemoSystemComponent::Reflect(AZ::ReflectContext* context)
  8. {
  9. if (AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context))
  10. {
  11. serialize->Class<ROSConDemoSystemComponent, AZ::Component>()->Version(0);
  12. if (AZ::EditContext* ec = serialize->GetEditContext())
  13. {
  14. ec->Class<ROSConDemoSystemComponent>("ROSConDemo", "[Description of functionality provided by this System Component]")
  15. ->ClassElement(AZ::Edit::ClassElements::EditorData, "")
  16. ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System"))
  17. ->Attribute(AZ::Edit::Attributes::AutoExpand, true);
  18. }
  19. }
  20. }
  21. void ROSConDemoSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
  22. {
  23. provided.push_back(AZ_CRC("ROSConDemoService"));
  24. }
  25. void ROSConDemoSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
  26. {
  27. incompatible.push_back(AZ_CRC("ROSConDemoService"));
  28. }
  29. void ROSConDemoSystemComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required)
  30. {
  31. }
  32. void ROSConDemoSystemComponent::GetDependentServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& dependent)
  33. {
  34. }
  35. ROSConDemoSystemComponent::ROSConDemoSystemComponent()
  36. {
  37. if (ROSConDemoInterface::Get() == nullptr)
  38. {
  39. ROSConDemoInterface::Register(this);
  40. }
  41. }
  42. ROSConDemoSystemComponent::~ROSConDemoSystemComponent()
  43. {
  44. if (ROSConDemoInterface::Get() == this)
  45. {
  46. ROSConDemoInterface::Unregister(this);
  47. }
  48. }
  49. void ROSConDemoSystemComponent::Init()
  50. {
  51. }
  52. void ROSConDemoSystemComponent::Activate()
  53. {
  54. ROSConDemoRequestBus::Handler::BusConnect();
  55. }
  56. void ROSConDemoSystemComponent::Deactivate()
  57. {
  58. ROSConDemoRequestBus::Handler::BusDisconnect();
  59. }
  60. } // namespace ROSConDemo