ROSConDemoSystemComponent.cpp 2.4 KB

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