objc2_gameplay_kit/generated/
GKAgent.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11 pub unsafe trait GKAgentDelegate: NSObjectProtocol {
15 #[cfg(feature = "GKComponent")]
16 #[optional]
17 #[unsafe(method(agentWillUpdate:))]
18 #[unsafe(method_family = none)]
19 unsafe fn agentWillUpdate(&self, agent: &GKAgent);
20
21 #[cfg(feature = "GKComponent")]
22 #[optional]
23 #[unsafe(method(agentDidUpdate:))]
24 #[unsafe(method_family = none)]
25 unsafe fn agentDidUpdate(&self, agent: &GKAgent);
26 }
27);
28
29extern_class!(
30 #[unsafe(super(GKComponent, NSObject))]
42 #[derive(Debug, PartialEq, Eq, Hash)]
43 #[cfg(feature = "GKComponent")]
44 pub struct GKAgent;
45);
46
47#[cfg(feature = "GKComponent")]
48extern_conformance!(
49 unsafe impl NSCoding for GKAgent {}
50);
51
52#[cfg(feature = "GKComponent")]
53extern_conformance!(
54 unsafe impl NSCopying for GKAgent {}
55);
56
57#[cfg(feature = "GKComponent")]
58unsafe impl CopyingHelper for GKAgent {
59 type Result = Self;
60}
61
62#[cfg(feature = "GKComponent")]
63extern_conformance!(
64 unsafe impl NSObjectProtocol for GKAgent {}
65);
66
67#[cfg(feature = "GKComponent")]
68extern_conformance!(
69 unsafe impl NSSecureCoding for GKAgent {}
70);
71
72#[cfg(feature = "GKComponent")]
73impl GKAgent {
74 extern_methods!(
75 #[unsafe(method(delegate))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn GKAgentDelegate>>>;
79
80 #[unsafe(method(setDelegate:))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn GKAgentDelegate>>);
86
87 #[cfg(feature = "GKBehavior")]
88 #[unsafe(method(behavior))]
91 #[unsafe(method_family = none)]
92 pub unsafe fn behavior(&self) -> Option<Retained<GKBehavior>>;
93
94 #[cfg(feature = "GKBehavior")]
95 #[unsafe(method(setBehavior:))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn setBehavior(&self, behavior: Option<&GKBehavior>);
99
100 #[unsafe(method(mass))]
104 #[unsafe(method_family = none)]
105 pub unsafe fn mass(&self) -> c_float;
106
107 #[unsafe(method(setMass:))]
109 #[unsafe(method_family = none)]
110 pub unsafe fn setMass(&self, mass: c_float);
111
112 #[unsafe(method(radius))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn radius(&self) -> c_float;
118
119 #[unsafe(method(setRadius:))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn setRadius(&self, radius: c_float);
123
124 #[unsafe(method(speed))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn speed(&self) -> c_float;
130
131 #[unsafe(method(setSpeed:))]
133 #[unsafe(method_family = none)]
134 pub unsafe fn setSpeed(&self, speed: c_float);
135
136 #[unsafe(method(maxAcceleration))]
140 #[unsafe(method_family = none)]
141 pub unsafe fn maxAcceleration(&self) -> c_float;
142
143 #[unsafe(method(setMaxAcceleration:))]
145 #[unsafe(method_family = none)]
146 pub unsafe fn setMaxAcceleration(&self, max_acceleration: c_float);
147
148 #[unsafe(method(maxSpeed))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn maxSpeed(&self) -> c_float;
154
155 #[unsafe(method(setMaxSpeed:))]
157 #[unsafe(method_family = none)]
158 pub unsafe fn setMaxSpeed(&self, max_speed: c_float);
159 );
160}
161
162#[cfg(feature = "GKComponent")]
164impl GKAgent {
165 extern_methods!(
166 #[unsafe(method(init))]
167 #[unsafe(method_family = init)]
168 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
169
170 #[unsafe(method(new))]
171 #[unsafe(method_family = new)]
172 pub unsafe fn new() -> Retained<Self>;
173 );
174}
175
176extern_class!(
177 #[unsafe(super(GKAgent, GKComponent, NSObject))]
184 #[derive(Debug, PartialEq, Eq, Hash)]
185 #[cfg(feature = "GKComponent")]
186 pub struct GKAgent2D;
187);
188
189#[cfg(feature = "GKComponent")]
190extern_conformance!(
191 unsafe impl NSCoding for GKAgent2D {}
192);
193
194#[cfg(feature = "GKComponent")]
195extern_conformance!(
196 unsafe impl NSCopying for GKAgent2D {}
197);
198
199#[cfg(feature = "GKComponent")]
200unsafe impl CopyingHelper for GKAgent2D {
201 type Result = Self;
202}
203
204#[cfg(feature = "GKComponent")]
205extern_conformance!(
206 unsafe impl NSObjectProtocol for GKAgent2D {}
207);
208
209#[cfg(feature = "GKComponent")]
210extern_conformance!(
211 unsafe impl NSSecureCoding for GKAgent2D {}
212);
213
214#[cfg(feature = "GKComponent")]
215impl GKAgent2D {
216 extern_methods!(
217 #[unsafe(method(rotation))]
219 #[unsafe(method_family = none)]
220 pub unsafe fn rotation(&self) -> c_float;
221
222 #[unsafe(method(setRotation:))]
224 #[unsafe(method_family = none)]
225 pub unsafe fn setRotation(&self, rotation: c_float);
226
227 #[unsafe(method(updateWithDeltaTime:))]
230 #[unsafe(method_family = none)]
231 pub unsafe fn updateWithDeltaTime(&self, seconds: NSTimeInterval);
232 );
233}
234
235#[cfg(feature = "GKComponent")]
237impl GKAgent2D {
238 extern_methods!(
239 #[unsafe(method(init))]
240 #[unsafe(method_family = init)]
241 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
242
243 #[unsafe(method(new))]
244 #[unsafe(method_family = new)]
245 pub unsafe fn new() -> Retained<Self>;
246 );
247}
248
249extern_class!(
250 #[unsafe(super(GKAgent, GKComponent, NSObject))]
254 #[derive(Debug, PartialEq, Eq, Hash)]
255 #[cfg(feature = "GKComponent")]
256 pub struct GKAgent3D;
257);
258
259#[cfg(feature = "GKComponent")]
260extern_conformance!(
261 unsafe impl NSCoding for GKAgent3D {}
262);
263
264#[cfg(feature = "GKComponent")]
265extern_conformance!(
266 unsafe impl NSCopying for GKAgent3D {}
267);
268
269#[cfg(feature = "GKComponent")]
270unsafe impl CopyingHelper for GKAgent3D {
271 type Result = Self;
272}
273
274#[cfg(feature = "GKComponent")]
275extern_conformance!(
276 unsafe impl NSObjectProtocol for GKAgent3D {}
277);
278
279#[cfg(feature = "GKComponent")]
280extern_conformance!(
281 unsafe impl NSSecureCoding for GKAgent3D {}
282);
283
284#[cfg(feature = "GKComponent")]
285impl GKAgent3D {
286 extern_methods!(
287 #[unsafe(method(rightHanded))]
289 #[unsafe(method_family = none)]
290 pub unsafe fn rightHanded(&self) -> bool;
291
292 #[unsafe(method(setRightHanded:))]
294 #[unsafe(method_family = none)]
295 pub unsafe fn setRightHanded(&self, right_handed: bool);
296
297 #[unsafe(method(updateWithDeltaTime:))]
300 #[unsafe(method_family = none)]
301 pub unsafe fn updateWithDeltaTime(&self, seconds: NSTimeInterval);
302 );
303}
304
305#[cfg(feature = "GKComponent")]
307impl GKAgent3D {
308 extern_methods!(
309 #[unsafe(method(init))]
310 #[unsafe(method_family = init)]
311 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
312
313 #[unsafe(method(new))]
314 #[unsafe(method_family = new)]
315 pub unsafe fn new() -> Retained<Self>;
316 );
317}