objc2_gameplay_kit/generated/
GKObstacleGraph.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(GKGraph, NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 #[cfg(all(feature = "GKGraph", feature = "GKGraphNode"))]
17 pub struct GKObstacleGraph<NodeType: ?Sized = AnyObject>;
18);
19
20#[cfg(all(feature = "GKGraph", feature = "GKGraphNode"))]
21impl<NodeType: ?Sized + Message + AsRef<GKGraphNode2D>> GKObstacleGraph<NodeType> {
22 #[inline]
28 pub unsafe fn cast_unchecked<NewNodeType: ?Sized + Message + AsRef<GKGraphNode2D>>(
29 &self,
30 ) -> &GKObstacleGraph<NewNodeType> {
31 unsafe { &*((self as *const Self).cast()) }
32 }
33}
34
35#[cfg(all(feature = "GKGraph", feature = "GKGraphNode"))]
36extern_conformance!(
37 unsafe impl<NodeType: ?Sized + NSCoding + AsRef<GKGraphNode2D>> NSCoding
38 for GKObstacleGraph<NodeType>
39 {
40 }
41);
42
43#[cfg(all(feature = "GKGraph", feature = "GKGraphNode"))]
44extern_conformance!(
45 unsafe impl<NodeType: ?Sized + AsRef<GKGraphNode2D>> NSCopying for GKObstacleGraph<NodeType> {}
46);
47
48#[cfg(all(feature = "GKGraph", feature = "GKGraphNode"))]
49unsafe impl<NodeType: ?Sized + Message + AsRef<GKGraphNode2D>> CopyingHelper
50 for GKObstacleGraph<NodeType>
51{
52 type Result = Self;
53}
54
55#[cfg(all(feature = "GKGraph", feature = "GKGraphNode"))]
56extern_conformance!(
57 unsafe impl<NodeType: ?Sized + AsRef<GKGraphNode2D>> NSObjectProtocol
58 for GKObstacleGraph<NodeType>
59 {
60 }
61);
62
63#[cfg(all(feature = "GKGraph", feature = "GKGraphNode"))]
64extern_conformance!(
65 unsafe impl<NodeType: ?Sized + NSSecureCoding + AsRef<GKGraphNode2D>> NSSecureCoding
66 for GKObstacleGraph<NodeType>
67 {
68 }
69);
70
71#[cfg(all(feature = "GKGraph", feature = "GKGraphNode"))]
72impl<NodeType: Message + AsRef<GKGraphNode2D>> GKObstacleGraph<NodeType> {
73 extern_methods!(
74 #[cfg(feature = "GKObstacle")]
75 #[unsafe(method(obstacles))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn obstacles(&self) -> Retained<NSArray<GKPolygonObstacle>>;
78
79 #[unsafe(method(bufferRadius))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn bufferRadius(&self) -> c_float;
82
83 #[cfg(feature = "GKObstacle")]
84 #[unsafe(method(graphWithObstacles:bufferRadius:))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn graphWithObstacles_bufferRadius(
95 obstacles: &NSArray<GKPolygonObstacle>,
96 buffer_radius: c_float,
97 ) -> Retained<Self>;
98
99 #[cfg(feature = "GKObstacle")]
100 #[unsafe(method(initWithObstacles:bufferRadius:))]
101 #[unsafe(method_family = init)]
102 pub unsafe fn initWithObstacles_bufferRadius(
103 this: Allocated<Self>,
104 obstacles: &NSArray<GKPolygonObstacle>,
105 buffer_radius: c_float,
106 ) -> Retained<Self>;
107
108 #[cfg(feature = "GKObstacle")]
109 #[unsafe(method(graphWithObstacles:bufferRadius:nodeClass:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn graphWithObstacles_bufferRadius_nodeClass(
126 obstacles: &NSArray<GKPolygonObstacle>,
127 buffer_radius: c_float,
128 node_class: &AnyClass,
129 ) -> Retained<Self>;
130
131 #[cfg(feature = "GKObstacle")]
132 #[unsafe(method(initWithObstacles:bufferRadius:nodeClass:))]
136 #[unsafe(method_family = init)]
137 pub unsafe fn initWithObstacles_bufferRadius_nodeClass(
138 this: Allocated<Self>,
139 obstacles: &NSArray<GKPolygonObstacle>,
140 buffer_radius: c_float,
141 node_class: &AnyClass,
142 ) -> Retained<Self>;
143
144 #[unsafe(method(connectNodeUsingObstacles:))]
149 #[unsafe(method_family = none)]
150 pub unsafe fn connectNodeUsingObstacles(&self, node: &NodeType);
151
152 #[cfg(feature = "GKObstacle")]
153 #[unsafe(method(connectNodeUsingObstacles:ignoringObstacles:))]
155 #[unsafe(method_family = none)]
156 pub unsafe fn connectNodeUsingObstacles_ignoringObstacles(
157 &self,
158 node: &NodeType,
159 obstacles_to_ignore: &NSArray<GKPolygonObstacle>,
160 );
161
162 #[cfg(feature = "GKObstacle")]
163 #[unsafe(method(connectNodeUsingObstacles:ignoringBufferRadiusOfObstacles:))]
165 #[unsafe(method_family = none)]
166 pub unsafe fn connectNodeUsingObstacles_ignoringBufferRadiusOfObstacles(
167 &self,
168 node: &NodeType,
169 obstacles_buffer_radius_to_ignore: &NSArray<GKPolygonObstacle>,
170 );
171
172 #[cfg(feature = "GKObstacle")]
173 #[unsafe(method(addObstacles:))]
182 #[unsafe(method_family = none)]
183 pub unsafe fn addObstacles(&self, obstacles: &NSArray<GKPolygonObstacle>);
184
185 #[cfg(feature = "GKObstacle")]
186 #[unsafe(method(removeObstacles:))]
193 #[unsafe(method_family = none)]
194 pub unsafe fn removeObstacles(&self, obstacles: &NSArray<GKPolygonObstacle>);
195
196 #[unsafe(method(removeAllObstacles))]
198 #[unsafe(method_family = none)]
199 pub unsafe fn removeAllObstacles(&self);
200
201 #[cfg(feature = "GKObstacle")]
202 #[unsafe(method(nodesForObstacle:))]
206 #[unsafe(method_family = none)]
207 pub unsafe fn nodesForObstacle(
208 &self,
209 obstacle: &GKPolygonObstacle,
210 ) -> Retained<NSArray<NodeType>>;
211
212 #[unsafe(method(lockConnectionFromNode:toNode:))]
218 #[unsafe(method_family = none)]
219 pub unsafe fn lockConnectionFromNode_toNode(
220 &self,
221 start_node: &NodeType,
222 end_node: &NodeType,
223 );
224
225 #[unsafe(method(unlockConnectionFromNode:toNode:))]
233 #[unsafe(method_family = none)]
234 pub unsafe fn unlockConnectionFromNode_toNode(
235 &self,
236 start_node: &NodeType,
237 end_node: &NodeType,
238 );
239
240 #[unsafe(method(isConnectionLockedFromNode:toNode:))]
252 #[unsafe(method_family = none)]
253 pub unsafe fn isConnectionLockedFromNode_toNode(
254 &self,
255 start_node: &NodeType,
256 end_node: &NodeType,
257 ) -> bool;
258
259 #[unsafe(method(classForGenericArgumentAtIndex:))]
261 #[unsafe(method_family = none)]
262 pub unsafe fn classForGenericArgumentAtIndex(&self, index: NSUInteger)
263 -> &'static AnyClass;
264 );
265}
266
267#[cfg(all(feature = "GKGraph", feature = "GKGraphNode"))]
269impl<NodeType: Message + AsRef<GKGraphNode2D>> GKObstacleGraph<NodeType> {
270 extern_methods!(
271 #[unsafe(method(graphWithNodes:))]
275 #[unsafe(method_family = none)]
276 pub unsafe fn graphWithNodes(nodes: &NSArray<GKGraphNode>) -> Retained<Self>;
277
278 #[unsafe(method(initWithNodes:))]
279 #[unsafe(method_family = init)]
280 pub unsafe fn initWithNodes(
281 this: Allocated<Self>,
282 nodes: &NSArray<GKGraphNode>,
283 ) -> Retained<Self>;
284 );
285}
286
287#[cfg(all(feature = "GKGraph", feature = "GKGraphNode"))]
289impl<NodeType: Message + AsRef<GKGraphNode2D>> GKObstacleGraph<NodeType> {
290 extern_methods!(
291 #[unsafe(method(init))]
292 #[unsafe(method_family = init)]
293 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
294
295 #[unsafe(method(new))]
296 #[unsafe(method_family = new)]
297 pub unsafe fn new() -> Retained<Self>;
298 );
299}