ApplePickerComponent.cpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 "ApplePickerComponent.h"
  9. #include <AzCore/Serialization/EditContext.h>
  10. #include <AzCore/Serialization/EditContextConstants.inl>
  11. // #include <ROS2/ROS2Bus.h>
  12. namespace AppleKraken
  13. {
  14. void ApplePickerComponent::StartAutomatedOperation() // Probably to be connected to another bus
  15. {
  16. }
  17. void ApplePickerComponent::Activate()
  18. {
  19. }
  20. void ApplePickerComponent::Deactivate()
  21. {
  22. }
  23. void ApplePickerComponent::Reflect(AZ::ReflectContext* context)
  24. {
  25. if (AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context))
  26. {
  27. serialize->Class<ApplePickerComponent, AZ::Component>()->Version(1);
  28. if (AZ::EditContext* ec = serialize->GetEditContext())
  29. {
  30. ec->Class<ApplePickerComponent>("Apple picking component", "A demo component for apple picking")
  31. ->ClassElement(AZ::Edit::ClassElements::EditorData, "")
  32. ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Game"))
  33. ->Attribute(AZ::Edit::Attributes::Category, "AppleKraken");
  34. }
  35. }
  36. }
  37. void ApplePickerComponent::ApplePicked(AZ::EntityId appleId)
  38. {
  39. AZ_TracePrintf("ApplePicker", "Picked apple id %s\n", appleId.ToString().c_str());
  40. }
  41. void ApplePickerComponent::AppleRetrieved()
  42. {
  43. AZ_TracePrintf("ApplePicker", "An apple has been retrieved and stored\n");
  44. }
  45. void ApplePickerComponent::PickingFailed(AZ::EntityId appleId, const AZStd::string& reason)
  46. {
  47. AZ_TracePrintf("ApplePicker", "Picking apple %s failed due to: %s\n", appleId.ToString().c_str(), reason.c_str());
  48. }
  49. } // namespace AppleKraken