2
0

StarterGameSystemComponent.cpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #include <AzCore/Serialization/SerializeContext.h>
  2. #include "StarterGameSystemComponent.h"
  3. #include <StarterGame/StarterGameTypeIds.h>
  4. namespace StarterGame
  5. {
  6. AZ_COMPONENT_IMPL(StarterGameSystemComponent, "StarterGameSystemComponent",
  7. StarterGameSystemComponentTypeId);
  8. void StarterGameSystemComponent::Reflect(AZ::ReflectContext* context)
  9. {
  10. if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
  11. {
  12. serializeContext->Class<StarterGameSystemComponent, AZ::Component>()
  13. ->Version(0)
  14. ;
  15. }
  16. }
  17. void StarterGameSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
  18. {
  19. provided.push_back(AZ_CRC_CE("StarterGameService"));
  20. }
  21. void StarterGameSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
  22. {
  23. incompatible.push_back(AZ_CRC_CE("StarterGameService"));
  24. }
  25. void StarterGameSystemComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required)
  26. {
  27. }
  28. void StarterGameSystemComponent::GetDependentServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& dependent)
  29. {
  30. }
  31. StarterGameSystemComponent::StarterGameSystemComponent()
  32. {
  33. if (StarterGameInterface::Get() == nullptr)
  34. {
  35. StarterGameInterface::Register(this);
  36. }
  37. }
  38. StarterGameSystemComponent::~StarterGameSystemComponent()
  39. {
  40. if (StarterGameInterface::Get() == this)
  41. {
  42. StarterGameInterface::Unregister(this);
  43. }
  44. }
  45. void StarterGameSystemComponent::Init()
  46. {
  47. }
  48. void StarterGameSystemComponent::Activate()
  49. {
  50. StarterGameRequestBus::Handler::BusConnect();
  51. }
  52. void StarterGameSystemComponent::Deactivate()
  53. {
  54. StarterGameRequestBus::Handler::BusDisconnect();
  55. }
  56. }