objc2_gameplay_kit/generated/
GKObstacle.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    /// Represents an impassible area in 2D space.
12    /// Able to be avoided by GKAgent's steering functions
13    /// GKGraph can generate navigation graphs from a list of obstacles
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/gameplaykit/gkobstacle?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    pub struct GKObstacle;
19);
20
21extern_conformance!(
22    unsafe impl NSObjectProtocol for GKObstacle {}
23);
24
25impl GKObstacle {
26    extern_methods!();
27}
28
29/// Methods declared on superclass `NSObject`.
30impl GKObstacle {
31    extern_methods!(
32        #[unsafe(method(init))]
33        #[unsafe(method_family = init)]
34        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
35
36        #[unsafe(method(new))]
37        #[unsafe(method_family = new)]
38        pub unsafe fn new() -> Retained<Self>;
39    );
40}
41
42extern_class!(
43    /// An obstacle with an impassible radius
44    ///
45    /// See also [Apple's documentation](https://developer.apple.com/documentation/gameplaykit/gkcircleobstacle?language=objc)
46    #[unsafe(super(GKObstacle, NSObject))]
47    #[derive(Debug, PartialEq, Eq, Hash)]
48    pub struct GKCircleObstacle;
49);
50
51extern_conformance!(
52    unsafe impl NSObjectProtocol for GKCircleObstacle {}
53);
54
55impl GKCircleObstacle {
56    extern_methods!(
57        /// Radius of the impassible circle
58        #[unsafe(method(radius))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn radius(&self) -> c_float;
61
62        /// Setter for [`radius`][Self::radius].
63        #[unsafe(method(setRadius:))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn setRadius(&self, radius: c_float);
66
67        #[unsafe(method(obstacleWithRadius:))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn obstacleWithRadius(radius: c_float) -> Retained<Self>;
70
71        #[unsafe(method(initWithRadius:))]
72        #[unsafe(method_family = init)]
73        pub unsafe fn initWithRadius(this: Allocated<Self>, radius: c_float) -> Retained<Self>;
74    );
75}
76
77/// Methods declared on superclass `NSObject`.
78impl GKCircleObstacle {
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}
89
90extern_class!(
91    /// An obstacle with an impassible closed polygon
92    ///
93    /// See also [Apple's documentation](https://developer.apple.com/documentation/gameplaykit/gkpolygonobstacle?language=objc)
94    #[unsafe(super(GKObstacle, NSObject))]
95    #[derive(Debug, PartialEq, Eq, Hash)]
96    pub struct GKPolygonObstacle;
97);
98
99extern_conformance!(
100    unsafe impl NSCoding for GKPolygonObstacle {}
101);
102
103extern_conformance!(
104    unsafe impl NSObjectProtocol for GKPolygonObstacle {}
105);
106
107extern_conformance!(
108    unsafe impl NSSecureCoding for GKPolygonObstacle {}
109);
110
111impl GKPolygonObstacle {
112    extern_methods!(
113        /// Number of vertices on this polygon
114        #[unsafe(method(vertexCount))]
115        #[unsafe(method_family = none)]
116        pub unsafe fn vertexCount(&self) -> NSUInteger;
117    );
118}
119
120/// Methods declared on superclass `NSObject`.
121impl GKPolygonObstacle {
122    extern_methods!(
123        #[unsafe(method(init))]
124        #[unsafe(method_family = init)]
125        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
126
127        #[unsafe(method(new))]
128        #[unsafe(method_family = new)]
129        pub unsafe fn new() -> Retained<Self>;
130    );
131}
132
133extern_class!(
134    /// An obstacle with an impassible radius in 3D space
135    /// For use with GKAgent3D.  Using this with a GKAgent2D is no different than using GKCircleObstacle.
136    ///
137    /// See also [Apple's documentation](https://developer.apple.com/documentation/gameplaykit/gksphereobstacle?language=objc)
138    #[unsafe(super(GKObstacle, NSObject))]
139    #[derive(Debug, PartialEq, Eq, Hash)]
140    pub struct GKSphereObstacle;
141);
142
143extern_conformance!(
144    unsafe impl NSObjectProtocol for GKSphereObstacle {}
145);
146
147impl GKSphereObstacle {
148    extern_methods!(
149        /// Radius of the impassible circle
150        #[unsafe(method(radius))]
151        #[unsafe(method_family = none)]
152        pub unsafe fn radius(&self) -> c_float;
153
154        /// Setter for [`radius`][Self::radius].
155        #[unsafe(method(setRadius:))]
156        #[unsafe(method_family = none)]
157        pub unsafe fn setRadius(&self, radius: c_float);
158
159        #[unsafe(method(obstacleWithRadius:))]
160        #[unsafe(method_family = none)]
161        pub unsafe fn obstacleWithRadius(radius: c_float) -> Retained<Self>;
162
163        #[unsafe(method(initWithRadius:))]
164        #[unsafe(method_family = init)]
165        pub unsafe fn initWithRadius(this: Allocated<Self>, radius: c_float) -> Retained<Self>;
166    );
167}
168
169/// Methods declared on superclass `NSObject`.
170impl GKSphereObstacle {
171    extern_methods!(
172        #[unsafe(method(init))]
173        #[unsafe(method_family = init)]
174        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
175
176        #[unsafe(method(new))]
177        #[unsafe(method_family = new)]
178        pub unsafe fn new() -> Retained<Self>;
179    );
180}