objc2_sprite_kit/generated/
SKTileSet.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::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12/// The tile set type is used to describe how the tiles will be arranged in a tile map.
13///
14/// See also [Apple's documentation](https://developer.apple.com/documentation/spritekit/sktilesettype?language=objc)
15// NS_ENUM
16#[repr(transparent)]
17#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
18pub struct SKTileSetType(pub NSUInteger);
19impl SKTileSetType {
20    #[doc(alias = "SKTileSetTypeGrid")]
21    pub const Grid: Self = Self(0);
22    #[doc(alias = "SKTileSetTypeIsometric")]
23    pub const Isometric: Self = Self(1);
24    #[doc(alias = "SKTileSetTypeHexagonalFlat")]
25    pub const HexagonalFlat: Self = Self(2);
26    #[doc(alias = "SKTileSetTypeHexagonalPointy")]
27    pub const HexagonalPointy: Self = Self(3);
28}
29
30unsafe impl Encode for SKTileSetType {
31    const ENCODING: Encoding = NSUInteger::ENCODING;
32}
33
34unsafe impl RefEncode for SKTileSetType {
35    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
36}
37
38/// The adjacency mask is used to specify which neighboring tiles need to be filled in for a rule to go into effect.
39///
40/// See also [Apple's documentation](https://developer.apple.com/documentation/spritekit/sktileadjacencymask?language=objc)
41// NS_OPTIONS
42#[repr(transparent)]
43#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
44pub struct SKTileAdjacencyMask(pub NSUInteger);
45bitflags::bitflags! {
46    impl SKTileAdjacencyMask: NSUInteger {
47        #[doc(alias = "SKTileAdjacencyUp")]
48        const AdjacencyUp = 1<<0;
49        #[doc(alias = "SKTileAdjacencyUpperRight")]
50        const AdjacencyUpperRight = 1<<1;
51        #[doc(alias = "SKTileAdjacencyRight")]
52        const AdjacencyRight = 1<<2;
53        #[doc(alias = "SKTileAdjacencyLowerRight")]
54        const AdjacencyLowerRight = 1<<3;
55        #[doc(alias = "SKTileAdjacencyDown")]
56        const AdjacencyDown = 1<<4;
57        #[doc(alias = "SKTileAdjacencyLowerLeft")]
58        const AdjacencyLowerLeft = 1<<5;
59        #[doc(alias = "SKTileAdjacencyLeft")]
60        const AdjacencyLeft = 1<<6;
61        #[doc(alias = "SKTileAdjacencyUpperLeft")]
62        const AdjacencyUpperLeft = 1<<7;
63        #[doc(alias = "SKTileAdjacencyAll")]
64        const AdjacencyAll = SKTileAdjacencyMask::AdjacencyUp.0|SKTileAdjacencyMask::AdjacencyUpperRight.0|SKTileAdjacencyMask::AdjacencyRight.0|SKTileAdjacencyMask::AdjacencyLowerRight.0|SKTileAdjacencyMask::AdjacencyDown.0|SKTileAdjacencyMask::AdjacencyLowerLeft.0|SKTileAdjacencyMask::AdjacencyLeft.0|SKTileAdjacencyMask::AdjacencyUpperLeft.0;
65        #[doc(alias = "SKTileHexFlatAdjacencyUp")]
66        const HexFlatAdjacencyUp = 1<<0;
67        #[doc(alias = "SKTileHexFlatAdjacencyUpperRight")]
68        const HexFlatAdjacencyUpperRight = 1<<1;
69        #[doc(alias = "SKTileHexFlatAdjacencyLowerRight")]
70        const HexFlatAdjacencyLowerRight = 1<<2;
71        #[doc(alias = "SKTileHexFlatAdjacencyDown")]
72        const HexFlatAdjacencyDown = 1<<3;
73        #[doc(alias = "SKTileHexFlatAdjacencyLowerLeft")]
74        const HexFlatAdjacencyLowerLeft = 1<<4;
75        #[doc(alias = "SKTileHexFlatAdjacencyUpperLeft")]
76        const HexFlatAdjacencyUpperLeft = 1<<5;
77        #[doc(alias = "SKTileHexFlatAdjacencyAll")]
78        const HexFlatAdjacencyAll = SKTileAdjacencyMask::HexFlatAdjacencyUp.0|SKTileAdjacencyMask::HexFlatAdjacencyUpperRight.0|SKTileAdjacencyMask::HexFlatAdjacencyLowerRight.0|SKTileAdjacencyMask::HexFlatAdjacencyDown.0|SKTileAdjacencyMask::HexFlatAdjacencyLowerLeft.0|SKTileAdjacencyMask::HexFlatAdjacencyUpperLeft.0;
79        #[doc(alias = "SKTileHexPointyAdjacencyUpperLeft")]
80        const HexPointyAdjacencyUpperLeft = 1<<0;
81        #[doc(alias = "SKTileHexPointyAdjacencyUpperRight")]
82        const HexPointyAdjacencyUpperRight = 1<<1;
83        #[doc(alias = "SKTileHexPointyAdjacencyRight")]
84        const HexPointyAdjacencyRight = 1<<2;
85        #[doc(alias = "SKTileHexPointyAdjacencyLowerRight")]
86        const HexPointyAdjacencyLowerRight = 1<<3;
87        #[doc(alias = "SKTileHexPointyAdjacencyLowerLeft")]
88        const HexPointyAdjacencyLowerLeft = 1<<4;
89        #[doc(alias = "SKTileHexPointyAdjacencyLeft")]
90        const HexPointyAdjacencyLeft = 1<<5;
91        #[doc(alias = "SKTileHexPointyAdjacencyAdd")]
92        const HexPointyAdjacencyAdd = SKTileAdjacencyMask::HexPointyAdjacencyUpperLeft.0|SKTileAdjacencyMask::HexPointyAdjacencyUpperRight.0|SKTileAdjacencyMask::HexPointyAdjacencyRight.0|SKTileAdjacencyMask::HexPointyAdjacencyLowerRight.0|SKTileAdjacencyMask::HexPointyAdjacencyLowerLeft.0|SKTileAdjacencyMask::HexPointyAdjacencyLeft.0;
93        #[doc(alias = "SKTileAdjacencyUpEdge")]
94        const AdjacencyUpEdge = SKTileAdjacencyMask::AdjacencyRight.0|SKTileAdjacencyMask::AdjacencyLowerRight.0|SKTileAdjacencyMask::AdjacencyDown.0|SKTileAdjacencyMask::AdjacencyLowerLeft.0|SKTileAdjacencyMask::AdjacencyLeft.0;
95        #[doc(alias = "SKTileAdjacencyUpperRightEdge")]
96        const AdjacencyUpperRightEdge = SKTileAdjacencyMask::AdjacencyDown.0|SKTileAdjacencyMask::AdjacencyLowerLeft.0|SKTileAdjacencyMask::AdjacencyLeft.0;
97        #[doc(alias = "SKTileAdjacencyRightEdge")]
98        const AdjacencyRightEdge = SKTileAdjacencyMask::AdjacencyDown.0|SKTileAdjacencyMask::AdjacencyLowerLeft.0|SKTileAdjacencyMask::AdjacencyLeft.0|SKTileAdjacencyMask::AdjacencyUpperLeft.0|SKTileAdjacencyMask::AdjacencyUp.0;
99        #[doc(alias = "SKTileAdjacencyLowerRightEdge")]
100        const AdjacencyLowerRightEdge = SKTileAdjacencyMask::AdjacencyLeft.0|SKTileAdjacencyMask::AdjacencyUpperLeft.0|SKTileAdjacencyMask::AdjacencyUp.0;
101        #[doc(alias = "SKTileAdjacencyDownEdge")]
102        const AdjacencyDownEdge = SKTileAdjacencyMask::AdjacencyUp.0|SKTileAdjacencyMask::AdjacencyUpperRight.0|SKTileAdjacencyMask::AdjacencyRight.0|SKTileAdjacencyMask::AdjacencyLeft.0|SKTileAdjacencyMask::AdjacencyUpperLeft.0;
103        #[doc(alias = "SKTileAdjacencyLowerLeftEdge")]
104        const AdjacencyLowerLeftEdge = SKTileAdjacencyMask::AdjacencyUp.0|SKTileAdjacencyMask::AdjacencyUpperRight.0|SKTileAdjacencyMask::AdjacencyRight.0;
105        #[doc(alias = "SKTileAdjacencyLeftEdge")]
106        const AdjacencyLeftEdge = SKTileAdjacencyMask::AdjacencyUp.0|SKTileAdjacencyMask::AdjacencyUpperRight.0|SKTileAdjacencyMask::AdjacencyRight.0|SKTileAdjacencyMask::AdjacencyLowerRight.0|SKTileAdjacencyMask::AdjacencyDown.0;
107        #[doc(alias = "SKTileAdjacencyUpperLeftEdge")]
108        const AdjacencyUpperLeftEdge = SKTileAdjacencyMask::AdjacencyRight.0|SKTileAdjacencyMask::AdjacencyLowerRight.0|SKTileAdjacencyMask::AdjacencyDown.0;
109        #[doc(alias = "SKTileAdjacencyUpperRightCorner")]
110        const AdjacencyUpperRightCorner = SKTileAdjacencyMask::AdjacencyUp.0|SKTileAdjacencyMask::AdjacencyUpperRight.0|SKTileAdjacencyMask::AdjacencyRight.0|SKTileAdjacencyMask::AdjacencyLowerRight.0|SKTileAdjacencyMask::AdjacencyDown.0|SKTileAdjacencyMask::AdjacencyLeft.0|SKTileAdjacencyMask::AdjacencyUpperLeft.0;
111        #[doc(alias = "SKTileAdjacencyLowerRightCorner")]
112        const AdjacencyLowerRightCorner = SKTileAdjacencyMask::AdjacencyUp.0|SKTileAdjacencyMask::AdjacencyUpperRight.0|SKTileAdjacencyMask::AdjacencyRight.0|SKTileAdjacencyMask::AdjacencyLowerRight.0|SKTileAdjacencyMask::AdjacencyDown.0|SKTileAdjacencyMask::AdjacencyLowerLeft.0|SKTileAdjacencyMask::AdjacencyLeft.0;
113        #[doc(alias = "SKTileAdjacencyLowerLeftCorner")]
114        const AdjacencyLowerLeftCorner = SKTileAdjacencyMask::AdjacencyUp.0|SKTileAdjacencyMask::AdjacencyRight.0|SKTileAdjacencyMask::AdjacencyLowerRight.0|SKTileAdjacencyMask::AdjacencyDown.0|SKTileAdjacencyMask::AdjacencyLowerLeft.0|SKTileAdjacencyMask::AdjacencyLeft.0|SKTileAdjacencyMask::AdjacencyUpperLeft.0;
115        #[doc(alias = "SKTileAdjacencyUpperLeftCorner")]
116        const AdjacencyUpperLeftCorner = SKTileAdjacencyMask::AdjacencyUp.0|SKTileAdjacencyMask::AdjacencyUpperRight.0|SKTileAdjacencyMask::AdjacencyRight.0|SKTileAdjacencyMask::AdjacencyDown.0|SKTileAdjacencyMask::AdjacencyLowerLeft.0|SKTileAdjacencyMask::AdjacencyLeft.0|SKTileAdjacencyMask::AdjacencyUpperLeft.0;
117    }
118}
119
120unsafe impl Encode for SKTileAdjacencyMask {
121    const ENCODING: Encoding = NSUInteger::ENCODING;
122}
123
124unsafe impl RefEncode for SKTileAdjacencyMask {
125    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
126}
127
128extern_class!(
129    /// A tile set contains all of the tile definitions that are available for use in a tile map. In addition, it also contains tile groups, which define collections of related tile definitions and the rules that govern their placement.
130    ///
131    /// See also [Apple's documentation](https://developer.apple.com/documentation/spritekit/sktileset?language=objc)
132    #[unsafe(super(NSObject))]
133    #[derive(Debug, PartialEq, Eq, Hash)]
134    pub struct SKTileSet;
135);
136
137extern_conformance!(
138    unsafe impl NSCoding for SKTileSet {}
139);
140
141extern_conformance!(
142    unsafe impl NSCopying for SKTileSet {}
143);
144
145unsafe impl CopyingHelper for SKTileSet {
146    type Result = Self;
147}
148
149extern_conformance!(
150    unsafe impl NSObjectProtocol for SKTileSet {}
151);
152
153extern_conformance!(
154    unsafe impl NSSecureCoding for SKTileSet {}
155);
156
157impl SKTileSet {
158    extern_methods!(
159        /// Create a tile set with the specified tile groups.
160        ///
161        /// Parameter `tileGroups`: the tile groups that will be available for use with this set
162        #[unsafe(method(tileSetWithTileGroups:))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn tileSetWithTileGroups(tile_groups: &NSArray<SKTileGroup>) -> Retained<Self>;
165
166        /// Create a tile set with the specified tile groups and tile set type.
167        ///
168        /// Parameter `tileGroups`: the tile groups that will be available for use with this set
169        ///
170        /// Parameter `tileSetType`: the type of tile set this will be
171        #[unsafe(method(tileSetWithTileGroups:tileSetType:))]
172        #[unsafe(method_family = none)]
173        pub unsafe fn tileSetWithTileGroups_tileSetType(
174            tile_groups: &NSArray<SKTileGroup>,
175            tile_set_type: SKTileSetType,
176        ) -> Retained<Self>;
177
178        /// Initilize a tile set with the specified tile groups.
179        ///
180        /// Parameter `tileGroups`: the tile groups that will be available for use with this set
181        #[unsafe(method(initWithTileGroups:))]
182        #[unsafe(method_family = init)]
183        pub unsafe fn initWithTileGroups(
184            this: Allocated<Self>,
185            tile_groups: &NSArray<SKTileGroup>,
186        ) -> Retained<Self>;
187
188        /// Initilize a tile set with the specified tile groups and tile set type.
189        ///
190        /// Parameter `tileGroups`: the tile groups that will be available for use with this set
191        ///
192        /// Parameter `tileSetType`: the type of tile set this will be
193        #[unsafe(method(initWithTileGroups:tileSetType:))]
194        #[unsafe(method_family = init)]
195        pub unsafe fn initWithTileGroups_tileSetType(
196            this: Allocated<Self>,
197            tile_groups: &NSArray<SKTileGroup>,
198            tile_set_type: SKTileSetType,
199        ) -> Retained<Self>;
200
201        /// Gets the tile set with the specified name from the SpriteKit resource bundle. Returns nil if a tile set with a matching name cannot be found.
202        ///
203        /// Parameter `name`: the name of the tile set to search for
204        #[unsafe(method(tileSetNamed:))]
205        #[unsafe(method_family = none)]
206        pub unsafe fn tileSetNamed(name: &NSString) -> Option<Retained<Self>>;
207
208        /// Creates a tile set from the specified tile set file. Returns nil if the URL doesn't point to a valid tile set file.
209        ///
210        /// Parameter `url`: the URL of the tile set file
211        #[unsafe(method(tileSetFromURL:))]
212        #[unsafe(method_family = none)]
213        pub unsafe fn tileSetFromURL(url: &NSURL) -> Option<Retained<Self>>;
214
215        /// The tile groups that this set provides for use.
216        #[unsafe(method(tileGroups))]
217        #[unsafe(method_family = none)]
218        pub unsafe fn tileGroups(&self) -> Retained<NSArray<SKTileGroup>>;
219
220        /// Setter for [`tileGroups`][Self::tileGroups].
221        #[unsafe(method(setTileGroups:))]
222        #[unsafe(method_family = none)]
223        pub unsafe fn setTileGroups(&self, tile_groups: &NSArray<SKTileGroup>);
224
225        /// Client-assignable name for the tile set. Defaults to nil.
226        #[unsafe(method(name))]
227        #[unsafe(method_family = none)]
228        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
229
230        /// Setter for [`name`][Self::name].
231        #[unsafe(method(setName:))]
232        #[unsafe(method_family = none)]
233        pub unsafe fn setName(&self, name: Option<&NSString>);
234
235        /// The tile set type specifies how the tiles in the set will be arranged when placed in a tile map. Defaults to SKTileSetTypeGrid.
236        #[unsafe(method(type))]
237        #[unsafe(method_family = none)]
238        pub unsafe fn r#type(&self) -> SKTileSetType;
239
240        /// Setter for [`type`][Self::type].
241        #[unsafe(method(setType:))]
242        #[unsafe(method_family = none)]
243        pub unsafe fn setType(&self, r#type: SKTileSetType);
244
245        #[unsafe(method(defaultTileGroup))]
246        #[unsafe(method_family = none)]
247        pub unsafe fn defaultTileGroup(&self) -> Option<Retained<SKTileGroup>>;
248
249        /// Setter for [`defaultTileGroup`][Self::defaultTileGroup].
250        #[unsafe(method(setDefaultTileGroup:))]
251        #[unsafe(method_family = none)]
252        pub unsafe fn setDefaultTileGroup(&self, default_tile_group: Option<&SKTileGroup>);
253
254        #[cfg(feature = "objc2-core-foundation")]
255        /// The default tile size is the value an SKTileMapNode will use for it's tiles when the tile set is assigned to it.
256        #[unsafe(method(defaultTileSize))]
257        #[unsafe(method_family = none)]
258        pub unsafe fn defaultTileSize(&self) -> CGSize;
259
260        #[cfg(feature = "objc2-core-foundation")]
261        /// Setter for [`defaultTileSize`][Self::defaultTileSize].
262        #[unsafe(method(setDefaultTileSize:))]
263        #[unsafe(method_family = none)]
264        pub unsafe fn setDefaultTileSize(&self, default_tile_size: CGSize);
265    );
266}
267
268/// Methods declared on superclass `NSObject`.
269impl SKTileSet {
270    extern_methods!(
271        #[unsafe(method(init))]
272        #[unsafe(method_family = init)]
273        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
274
275        #[unsafe(method(new))]
276        #[unsafe(method_family = new)]
277        pub unsafe fn new() -> Retained<Self>;
278    );
279}
280
281extern_class!(
282    /// A tile group encapsulates a collection of related tile definitions that are designed to be pieced together within a tile map. How those tiles are pieced together is governed by the set of rules. When a tile group is placed in a tile map, the map evaluates the rules to determine which tiles should be placed to achieve the desired outcome.
283    ///
284    /// See also [Apple's documentation](https://developer.apple.com/documentation/spritekit/sktilegroup?language=objc)
285    #[unsafe(super(NSObject))]
286    #[derive(Debug, PartialEq, Eq, Hash)]
287    pub struct SKTileGroup;
288);
289
290extern_conformance!(
291    unsafe impl NSCoding for SKTileGroup {}
292);
293
294extern_conformance!(
295    unsafe impl NSCopying for SKTileGroup {}
296);
297
298unsafe impl CopyingHelper for SKTileGroup {
299    type Result = Self;
300}
301
302extern_conformance!(
303    unsafe impl NSObjectProtocol for SKTileGroup {}
304);
305
306extern_conformance!(
307    unsafe impl NSSecureCoding for SKTileGroup {}
308);
309
310impl SKTileGroup {
311    extern_methods!(
312        #[cfg(feature = "SKTileDefinition")]
313        /// Create a simple tile group for a single tile definition. This creates and initializes the SKTileGroupRule necessary to place the provided tile definition in a tile map.
314        ///
315        /// Parameter `tileDefinition`: the tile definition we wish to place in a tile map
316        #[unsafe(method(tileGroupWithTileDefinition:))]
317        #[unsafe(method_family = none)]
318        pub unsafe fn tileGroupWithTileDefinition(
319            tile_definition: &SKTileDefinition,
320        ) -> Retained<Self>;
321
322        /// Create a tile group with the specified rules.
323        ///
324        /// Parameter `rules`: the rules the group will use to determine tile placement
325        #[unsafe(method(tileGroupWithRules:))]
326        #[unsafe(method_family = none)]
327        pub unsafe fn tileGroupWithRules(rules: &NSArray<SKTileGroupRule>) -> Retained<Self>;
328
329        /// Create an empty tile group. Placing this in a tile map will erase the existing tile at that location.
330        #[unsafe(method(emptyTileGroup))]
331        #[unsafe(method_family = none)]
332        pub unsafe fn emptyTileGroup() -> Retained<Self>;
333
334        #[cfg(feature = "SKTileDefinition")]
335        /// Initilize a simple tile group for a single tile definition. This creates and initializes the SKTileGroupRule necessary to place the provided tile definition in a tile map.
336        ///
337        /// Parameter `tileDefinition`: tile definition we wish to place in a tile map
338        #[unsafe(method(initWithTileDefinition:))]
339        #[unsafe(method_family = init)]
340        pub unsafe fn initWithTileDefinition(
341            this: Allocated<Self>,
342            tile_definition: &SKTileDefinition,
343        ) -> Retained<Self>;
344
345        /// Initilize a tile group with the specified rules.
346        ///
347        /// Parameter `rules`: the rules the group will use to determine tile placement
348        #[unsafe(method(initWithRules:))]
349        #[unsafe(method_family = init)]
350        pub unsafe fn initWithRules(
351            this: Allocated<Self>,
352            rules: &NSArray<SKTileGroupRule>,
353        ) -> Retained<Self>;
354
355        /// The rules that govern which tiles are placed when this group is used, and where in the map they'll be placed.
356        #[unsafe(method(rules))]
357        #[unsafe(method_family = none)]
358        pub unsafe fn rules(&self) -> Retained<NSArray<SKTileGroupRule>>;
359
360        /// Setter for [`rules`][Self::rules].
361        #[unsafe(method(setRules:))]
362        #[unsafe(method_family = none)]
363        pub unsafe fn setRules(&self, rules: &NSArray<SKTileGroupRule>);
364
365        /// Client-assignable name for the tile group. Defaults to nil.
366        #[unsafe(method(name))]
367        #[unsafe(method_family = none)]
368        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
369
370        /// Setter for [`name`][Self::name].
371        #[unsafe(method(setName:))]
372        #[unsafe(method_family = none)]
373        pub unsafe fn setName(&self, name: Option<&NSString>);
374    );
375}
376
377/// Methods declared on superclass `NSObject`.
378impl SKTileGroup {
379    extern_methods!(
380        #[unsafe(method(init))]
381        #[unsafe(method_family = init)]
382        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
383
384        #[unsafe(method(new))]
385        #[unsafe(method_family = new)]
386        pub unsafe fn new() -> Retained<Self>;
387    );
388}
389
390extern_class!(
391    /// A tile group rule defines how a certain type of tile should be placed on the map. These tiles are like puzzle pieces, and the rules define how they should be pieced together. This is accomplished by defining which neighboring spaces need to be filled with tiles that belong to the same group, and which tiles are required to be empty. The required pattern of neighboring tiles is defined using the SKTileAdjacencyMask.
392    ///
393    /// See also [Apple's documentation](https://developer.apple.com/documentation/spritekit/sktilegrouprule?language=objc)
394    #[unsafe(super(NSObject))]
395    #[derive(Debug, PartialEq, Eq, Hash)]
396    pub struct SKTileGroupRule;
397);
398
399extern_conformance!(
400    unsafe impl NSCoding for SKTileGroupRule {}
401);
402
403extern_conformance!(
404    unsafe impl NSCopying for SKTileGroupRule {}
405);
406
407unsafe impl CopyingHelper for SKTileGroupRule {
408    type Result = Self;
409}
410
411extern_conformance!(
412    unsafe impl NSObjectProtocol for SKTileGroupRule {}
413);
414
415extern_conformance!(
416    unsafe impl NSSecureCoding for SKTileGroupRule {}
417);
418
419impl SKTileGroupRule {
420    extern_methods!(
421        #[cfg(feature = "SKTileDefinition")]
422        /// Create a tile group rule with the specified adjacency and tile definitions.
423        ///
424        /// Parameter `adjacency`: the adjacency requirements for this rule; use the mask that covers the adjacent spaces that must be filled with tiles belonging to the same group; tiles not masked out must be empty
425        ///
426        /// Parameter `tileDefinitions`: the tile definitions used for this rule
427        #[unsafe(method(tileGroupRuleWithAdjacency:tileDefinitions:))]
428        #[unsafe(method_family = none)]
429        pub unsafe fn tileGroupRuleWithAdjacency_tileDefinitions(
430            adjacency: SKTileAdjacencyMask,
431            tile_definitions: &NSArray<SKTileDefinition>,
432        ) -> Retained<Self>;
433
434        #[cfg(feature = "SKTileDefinition")]
435        /// Initilize a tile group rule with the specified adjacency and tile definitions.
436        ///
437        /// Parameter `adjacency`: the adjacency requirements for this rule; use the mask that covers the adjacent spaces that must be filled with tiles belonging to the same group; tiles not masked out must be empty
438        ///
439        /// Parameter `tileDefinitions`: the tile definitions used for this rule
440        #[unsafe(method(initWithAdjacency:tileDefinitions:))]
441        #[unsafe(method_family = init)]
442        pub unsafe fn initWithAdjacency_tileDefinitions(
443            this: Allocated<Self>,
444            adjacency: SKTileAdjacencyMask,
445            tile_definitions: &NSArray<SKTileDefinition>,
446        ) -> Retained<Self>;
447
448        /// The adjacency mask used by this rule. Set this to the mask that covers the adjacent spaces that must be filled with tiles belonging to the same group for this rule met.
449        #[unsafe(method(adjacency))]
450        #[unsafe(method_family = none)]
451        pub unsafe fn adjacency(&self) -> SKTileAdjacencyMask;
452
453        /// Setter for [`adjacency`][Self::adjacency].
454        #[unsafe(method(setAdjacency:))]
455        #[unsafe(method_family = none)]
456        pub unsafe fn setAdjacency(&self, adjacency: SKTileAdjacencyMask);
457
458        #[cfg(feature = "SKTileDefinition")]
459        /// The tile definitions used by this rule. If the rule is evaluated and its conditions are met, one of the tile definitions within this array will be randomly selected for placement within the tile map. Each tile definitions' placement weight is taken into consideration to determine how likely each is to be selected; tile definitions with higher placement weights will be selected more frequently than those with lower placement weights.
460        #[unsafe(method(tileDefinitions))]
461        #[unsafe(method_family = none)]
462        pub unsafe fn tileDefinitions(&self) -> Retained<NSArray<SKTileDefinition>>;
463
464        #[cfg(feature = "SKTileDefinition")]
465        /// Setter for [`tileDefinitions`][Self::tileDefinitions].
466        #[unsafe(method(setTileDefinitions:))]
467        #[unsafe(method_family = none)]
468        pub unsafe fn setTileDefinitions(&self, tile_definitions: &NSArray<SKTileDefinition>);
469
470        /// Client-assignable name for the tile group rule. Defaults to nil.
471        #[unsafe(method(name))]
472        #[unsafe(method_family = none)]
473        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
474
475        /// Setter for [`name`][Self::name].
476        #[unsafe(method(setName:))]
477        #[unsafe(method_family = none)]
478        pub unsafe fn setName(&self, name: Option<&NSString>);
479    );
480}
481
482/// Methods declared on superclass `NSObject`.
483impl SKTileGroupRule {
484    extern_methods!(
485        #[unsafe(method(init))]
486        #[unsafe(method_family = init)]
487        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
488
489        #[unsafe(method(new))]
490        #[unsafe(method_family = new)]
491        pub unsafe fn new() -> Retained<Self>;
492    );
493}