GameJam2021SystemComponent.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 "GameJam2021SystemComponent.h"
  5. namespace GameJam2021
  6. {
  7. void GameJam2021SystemComponent::Reflect(AZ::ReflectContext* context)
  8. {
  9. if (AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context))
  10. {
  11. serialize->Class<GameJam2021SystemComponent, AZ::Component>()
  12. ->Version(0)
  13. ;
  14. if (AZ::EditContext* ec = serialize->GetEditContext())
  15. {
  16. ec->Class<GameJam2021SystemComponent>("GameJam2021", "[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 GameJam2021SystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
  25. {
  26. provided.push_back(AZ_CRC("GameJam2021Service"));
  27. }
  28. void GameJam2021SystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
  29. {
  30. incompatible.push_back(AZ_CRC("GameJam2021Service"));
  31. }
  32. void GameJam2021SystemComponent::GetRequiredServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& required)
  33. {
  34. }
  35. void GameJam2021SystemComponent::GetDependentServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& dependent)
  36. {
  37. }
  38. GameJam2021SystemComponent::GameJam2021SystemComponent()
  39. {
  40. if (GameJam2021Interface::Get() == nullptr)
  41. {
  42. GameJam2021Interface::Register(this);
  43. }
  44. }
  45. GameJam2021SystemComponent::~GameJam2021SystemComponent()
  46. {
  47. if (GameJam2021Interface::Get() == this)
  48. {
  49. GameJam2021Interface::Unregister(this);
  50. }
  51. }
  52. void GameJam2021SystemComponent::Init()
  53. {
  54. }
  55. void GameJam2021SystemComponent::Activate()
  56. {
  57. GameJam2021RequestBus::Handler::BusConnect();
  58. }
  59. void GameJam2021SystemComponent::Deactivate()
  60. {
  61. GameJam2021RequestBus::Handler::BusDisconnect();
  62. }
  63. }