navigation_path_query_result_2d.cpp 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /**************************************************************************/
  2. /* navigation_path_query_result_2d.cpp */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /**************************************************************************/
  30. #include "navigation_path_query_result_2d.h"
  31. void NavigationPathQueryResult2D::set_path(const Vector<Vector2> &p_path) {
  32. path = p_path;
  33. }
  34. const Vector<Vector2> &NavigationPathQueryResult2D::get_path() const {
  35. return path;
  36. }
  37. void NavigationPathQueryResult2D::set_path_types(const Vector<int32_t> &p_path_types) {
  38. path_types = p_path_types;
  39. }
  40. const Vector<int32_t> &NavigationPathQueryResult2D::get_path_types() const {
  41. return path_types;
  42. }
  43. void NavigationPathQueryResult2D::set_path_rids(const TypedArray<RID> &p_path_rids) {
  44. path_rids = p_path_rids;
  45. }
  46. TypedArray<RID> NavigationPathQueryResult2D::get_path_rids() const {
  47. return path_rids;
  48. }
  49. void NavigationPathQueryResult2D::set_path_owner_ids(const Vector<int64_t> &p_path_owner_ids) {
  50. path_owner_ids = p_path_owner_ids;
  51. }
  52. const Vector<int64_t> &NavigationPathQueryResult2D::get_path_owner_ids() const {
  53. return path_owner_ids;
  54. }
  55. void NavigationPathQueryResult2D::reset() {
  56. path.clear();
  57. path_types.clear();
  58. path_rids.clear();
  59. path_owner_ids.clear();
  60. }
  61. void NavigationPathQueryResult2D::_bind_methods() {
  62. ClassDB::bind_method(D_METHOD("set_path", "path"), &NavigationPathQueryResult2D::set_path);
  63. ClassDB::bind_method(D_METHOD("get_path"), &NavigationPathQueryResult2D::get_path);
  64. ClassDB::bind_method(D_METHOD("set_path_types", "path_types"), &NavigationPathQueryResult2D::set_path_types);
  65. ClassDB::bind_method(D_METHOD("get_path_types"), &NavigationPathQueryResult2D::get_path_types);
  66. ClassDB::bind_method(D_METHOD("set_path_rids", "path_rids"), &NavigationPathQueryResult2D::set_path_rids);
  67. ClassDB::bind_method(D_METHOD("get_path_rids"), &NavigationPathQueryResult2D::get_path_rids);
  68. ClassDB::bind_method(D_METHOD("set_path_owner_ids", "path_owner_ids"), &NavigationPathQueryResult2D::set_path_owner_ids);
  69. ClassDB::bind_method(D_METHOD("get_path_owner_ids"), &NavigationPathQueryResult2D::get_path_owner_ids);
  70. ClassDB::bind_method(D_METHOD("reset"), &NavigationPathQueryResult2D::reset);
  71. ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR2_ARRAY, "path"), "set_path", "get_path");
  72. ADD_PROPERTY(PropertyInfo(Variant::PACKED_INT32_ARRAY, "path_types"), "set_path_types", "get_path_types");
  73. ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "path_rids", PROPERTY_HINT_ARRAY_TYPE, "RID"), "set_path_rids", "get_path_rids");
  74. ADD_PROPERTY(PropertyInfo(Variant::PACKED_INT64_ARRAY, "path_owner_ids"), "set_path_owner_ids", "get_path_owner_ids");
  75. BIND_ENUM_CONSTANT(PATH_SEGMENT_TYPE_REGION);
  76. BIND_ENUM_CONSTANT(PATH_SEGMENT_TYPE_LINK);
  77. }