ManipulatorRequestBus.cpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 "ManipulatorRequestBus.h"
  9. namespace AppleKraken
  10. {
  11. void ManipulatorRequestHandler::PickApple(const AZ::Vector3 position)
  12. {
  13. Call(FN_PickApple, position);
  14. }
  15. AZ::Vector3 ManipulatorRequestHandler::GetPosition()
  16. {
  17. AZ::Vector3 p;
  18. CallResult(p, FN_GetPosition);
  19. return p;
  20. }
  21. void ManipulatorRequestHandler::Retrieve()
  22. {
  23. Call(FN_Retrieve);
  24. }
  25. void ManipulatorRequestHandler::RetrieveNose()
  26. {
  27. Call(FN_RetrieveNose);
  28. }
  29. int ManipulatorRequestHandler::GetStatus()
  30. {
  31. int p;
  32. CallResult(p, FN_GetStatus);
  33. return p;
  34. }
  35. bool ManipulatorRequestHandler::IsNoseRetreived()
  36. {
  37. bool p;
  38. CallResult(p, FN_IsNoseRetreived);
  39. return p;
  40. }
  41. void ManipulatorRequestHandler::Reflect(AZ::ReflectContext* context)
  42. {
  43. if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
  44. {
  45. behaviorContext->EBus<ManipulatorRequestBus>("ManipulatorRequestBus")
  46. ->Handler<ManipulatorRequestHandler>()
  47. ->Event("PickApple", &ManipulatorRequestBus::Events::PickApple)
  48. ->Event("GetPosition", &ManipulatorRequestBus::Events::GetPosition)
  49. ->Event("Retrieve", &ManipulatorRequestBus::Events::Retrieve)
  50. ->Event("GetStatus", &ManipulatorRequestBus::Events::GetStatus)
  51. ->Event("IsNoseRetreived", &ManipulatorRequestBus::Events::IsNoseRetreived)
  52. ->Event("RetrieveNose", &ManipulatorRequestBus::Events::RetrieveNose);
  53. }
  54. }
  55. } // namespace AppleKraken