ManipulatorRequestBus.cpp 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. AZ::EntityId ManipulatorRequestHandler::GetEffectorEntity()
  42. {
  43. AZ::EntityId p;
  44. CallResult(p, FN_GetEffectorEntity);
  45. return p;
  46. }
  47. AZ::EntityId ManipulatorRequestHandler::GetRestEntity()
  48. {
  49. AZ::EntityId p;
  50. CallResult(p, FN_GetRestEntity);
  51. return p;
  52. }
  53. void ManipulatorRequestHandler::Reflect(AZ::ReflectContext* context)
  54. {
  55. if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
  56. {
  57. behaviorContext->EBus<ManipulatorRequestBus>("ManipulatorRequestBus")
  58. ->Handler<ManipulatorRequestHandler>()
  59. ->Event("PickApple", &ManipulatorRequestBus::Events::PickApple)
  60. ->Event("GetPosition", &ManipulatorRequestBus::Events::GetPosition)
  61. ->Event("Retrieve", &ManipulatorRequestBus::Events::Retrieve)
  62. ->Event("GetStatus", &ManipulatorRequestBus::Events::GetStatus)
  63. ->Event("GetEffectorEntity", &ManipulatorRequestBus::Events::GetEffectorEntity)
  64. ->Event("GetRestEntity", &ManipulatorRequestBus::Events::GetRestEntity)
  65. ->Event("IsNoseRetreived", &ManipulatorRequestBus::Events::IsNoseRetreived)
  66. ->Event("RetrieveNose", &ManipulatorRequestBus::Events::RetrieveNose);
  67. }
  68. }
  69. } // namespace AppleKraken