GatheringRowComponent.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #pragma once
  9. #include "GatheringRowRequests.h"
  10. #include <AzCore/Component/Component.h>
  11. #include <AzCore/Component/EntityId.h>
  12. namespace AppleKraken
  13. {
  14. //! Demo component wrapping information about gathering positions (single row of apple trees)
  15. class GatheringRowComponent
  16. : public AZ::Component
  17. , public GatheringRowRequestBus::Handler
  18. {
  19. public:
  20. AZ_COMPONENT(GatheringRowComponent, "{32987AAB-D275-40E0-B9BC-A8108522C055}", AZ::Component);
  21. GatheringRowComponent() = default;
  22. static void Reflect(AZ::ReflectContext* context);
  23. //! First on the list is always the start pose, the last is the end pose
  24. GatheringPoses GetGatheringPoses() override
  25. {
  26. if (m_gatheringPoses.empty())
  27. {
  28. ComputeGatheringPoses();
  29. }
  30. return m_gatheringPoses;
  31. }
  32. private:
  33. void Activate() override;
  34. void Deactivate() override;
  35. void ComputeGatheringPoses();
  36. AZ::Vector3 m_poseOffset = AZ::Vector3::CreateZero(); //!< Depends on robot / effector setting, exposed for experimenting
  37. GatheringPoses m_gatheringPoses;
  38. };
  39. } // namespace AppleKraken