objc2_gameplay_kit/generated/
GKPath.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/gameplaykit/gkpath?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct GKPath;
15);
16
17extern_conformance!(
18    unsafe impl NSObjectProtocol for GKPath {}
19);
20
21impl GKPath {
22    extern_methods!(
23        /// Radius of the pathway.  Defines a spatial area that the path occupies.
24        /// This can be though of as the union between rectangles between all points, and circles at each point
25        #[unsafe(method(radius))]
26        #[unsafe(method_family = none)]
27        pub unsafe fn radius(&self) -> c_float;
28
29        /// Setter for [`radius`][Self::radius].
30        #[unsafe(method(setRadius:))]
31        #[unsafe(method_family = none)]
32        pub unsafe fn setRadius(&self, radius: c_float);
33
34        /// Number of points in this path
35        #[unsafe(method(numPoints))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn numPoints(&self) -> NSUInteger;
38
39        /// Does this path loop back on itself, creating a cycle?
40        #[unsafe(method(isCyclical))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn isCyclical(&self) -> bool;
43
44        /// Setter for [`isCyclical`][Self::isCyclical].
45        #[unsafe(method(setCyclical:))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn setCyclical(&self, cyclical: bool);
48
49        #[cfg(feature = "GKGraphNode")]
50        /// Creates a path from an array of graph nodes (often a result of pathfinding)
51        /// Accepts GKGraphNode2D and GKGraphNode3D
52        /// Cyclical is set to NO
53        ///
54        /// Parameter `graphNodes`: an array of graph nodes to make a path from
55        ///
56        /// Parameter `radius`: radius of the path to create
57        ///
58        /// See: GKGraphNode
59        #[unsafe(method(pathWithGraphNodes:radius:))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn pathWithGraphNodes_radius(
62            graph_nodes: &NSArray<GKGraphNode>,
63            radius: c_float,
64        ) -> Retained<Self>;
65
66        #[cfg(feature = "GKGraphNode")]
67        #[unsafe(method(initWithGraphNodes:radius:))]
68        #[unsafe(method_family = init)]
69        pub unsafe fn initWithGraphNodes_radius(
70            this: Allocated<Self>,
71            graph_nodes: &NSArray<GKGraphNode>,
72            radius: c_float,
73        ) -> Retained<Self>;
74    );
75}
76
77/// Methods declared on superclass `NSObject`.
78impl GKPath {
79    extern_methods!(
80        #[unsafe(method(init))]
81        #[unsafe(method_family = init)]
82        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
83
84        #[unsafe(method(new))]
85        #[unsafe(method_family = new)]
86        pub unsafe fn new() -> Retained<Self>;
87    );
88}