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
137unsafe impl NSCoding for SKTileSet {}
138
139unsafe impl NSCopying for SKTileSet {}
140
141unsafe impl CopyingHelper for SKTileSet {
142    type Result = Self;
143}
144
145unsafe impl NSObjectProtocol for SKTileSet {}
146
147unsafe impl NSSecureCoding for SKTileSet {}
148
149impl SKTileSet {
150    extern_methods!(
151        /// Create a tile set with the specified tile groups.
152        ///
153        /// Parameter `tileGroups`: the tile groups that will be available for use with this set
154        #[unsafe(method(tileSetWithTileGroups:))]
155        #[unsafe(method_family = none)]
156        pub unsafe fn tileSetWithTileGroups(tile_groups: &NSArray<SKTileGroup>) -> Retained<Self>;
157
158        /// Create a tile set with the specified tile groups and tile set type.
159        ///
160        /// Parameter `tileGroups`: the tile groups that will be available for use with this set
161        ///
162        /// Parameter `tileSetType`: the type of tile set this will be
163        #[unsafe(method(tileSetWithTileGroups:tileSetType:))]
164        #[unsafe(method_family = none)]
165        pub unsafe fn tileSetWithTileGroups_tileSetType(
166            tile_groups: &NSArray<SKTileGroup>,
167            tile_set_type: SKTileSetType,
168        ) -> Retained<Self>;
169
170        /// Initilize a tile set with the specified tile groups.
171        ///
172        /// Parameter `tileGroups`: the tile groups that will be available for use with this set
173        #[unsafe(method(initWithTileGroups:))]
174        #[unsafe(method_family = init)]
175        pub unsafe fn initWithTileGroups(
176            this: Allocated<Self>,
177            tile_groups: &NSArray<SKTileGroup>,
178        ) -> Retained<Self>;
179
180        /// Initilize a tile set with the specified tile groups and tile set type.
181        ///
182        /// Parameter `tileGroups`: the tile groups that will be available for use with this set
183        ///
184        /// Parameter `tileSetType`: the type of tile set this will be
185        #[unsafe(method(initWithTileGroups:tileSetType:))]
186        #[unsafe(method_family = init)]
187        pub unsafe fn initWithTileGroups_tileSetType(
188            this: Allocated<Self>,
189            tile_groups: &NSArray<SKTileGroup>,
190            tile_set_type: SKTileSetType,
191        ) -> Retained<Self>;
192
193        /// 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.
194        ///
195        /// Parameter `name`: the name of the tile set to search for
196        #[unsafe(method(tileSetNamed:))]
197        #[unsafe(method_family = none)]
198        pub unsafe fn tileSetNamed(name: &NSString) -> Option<Retained<Self>>;
199
200        /// Creates a tile set from the specified tile set file. Returns nil if the URL doesn't point to a valid tile set file.
201        ///
202        /// Parameter `url`: the URL of the tile set file
203        #[unsafe(method(tileSetFromURL:))]
204        #[unsafe(method_family = none)]
205        pub unsafe fn tileSetFromURL(url: &NSURL) -> Option<Retained<Self>>;
206
207        /// The tile groups that this set provides for use.
208        #[unsafe(method(tileGroups))]
209        #[unsafe(method_family = none)]
210        pub unsafe fn tileGroups(&self) -> Retained<NSArray<SKTileGroup>>;
211
212        /// Setter for [`tileGroups`][Self::tileGroups].
213        #[unsafe(method(setTileGroups:))]
214        #[unsafe(method_family = none)]
215        pub unsafe fn setTileGroups(&self, tile_groups: &NSArray<SKTileGroup>);
216
217        /// Client-assignable name for the tile set. Defaults to nil.
218        #[unsafe(method(name))]
219        #[unsafe(method_family = none)]
220        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
221
222        /// Setter for [`name`][Self::name].
223        #[unsafe(method(setName:))]
224        #[unsafe(method_family = none)]
225        pub unsafe fn setName(&self, name: Option<&NSString>);
226
227        /// The tile set type specifies how the tiles in the set will be arranged when placed in a tile map. Defaults to SKTileSetTypeGrid.
228        #[unsafe(method(type))]
229        #[unsafe(method_family = none)]
230        pub unsafe fn r#type(&self) -> SKTileSetType;
231
232        /// Setter for [`type`][Self::type].
233        #[unsafe(method(setType:))]
234        #[unsafe(method_family = none)]
235        pub unsafe fn setType(&self, r#type: SKTileSetType);
236
237        #[unsafe(method(defaultTileGroup))]
238        #[unsafe(method_family = none)]
239        pub unsafe fn defaultTileGroup(&self) -> Option<Retained<SKTileGroup>>;
240
241        /// Setter for [`defaultTileGroup`][Self::defaultTileGroup].
242        #[unsafe(method(setDefaultTileGroup:))]
243        #[unsafe(method_family = none)]
244        pub unsafe fn setDefaultTileGroup(&self, default_tile_group: Option<&SKTileGroup>);
245
246        #[cfg(feature = "objc2-core-foundation")]
247        /// The default tile size is the value an SKTileMapNode will use for it's tiles when the tile set is assigned to it.
248        #[unsafe(method(defaultTileSize))]
249        #[unsafe(method_family = none)]
250        pub unsafe fn defaultTileSize(&self) -> CGSize;
251
252        #[cfg(feature = "objc2-core-foundation")]
253        /// Setter for [`defaultTileSize`][Self::defaultTileSize].
254        #[unsafe(method(setDefaultTileSize:))]
255        #[unsafe(method_family = none)]
256        pub unsafe fn setDefaultTileSize(&self, default_tile_size: CGSize);
257    );
258}
259
260/// Methods declared on superclass `NSObject`.
261impl SKTileSet {
262    extern_methods!(
263        #[unsafe(method(init))]
264        #[unsafe(method_family = init)]
265        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
266
267        #[unsafe(method(new))]
268        #[unsafe(method_family = new)]
269        pub unsafe fn new() -> Retained<Self>;
270    );
271}
272
273extern_class!(
274    /// 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.
275    ///
276    /// See also [Apple's documentation](https://developer.apple.com/documentation/spritekit/sktilegroup?language=objc)
277    #[unsafe(super(NSObject))]
278    #[derive(Debug, PartialEq, Eq, Hash)]
279    pub struct SKTileGroup;
280);
281
282unsafe impl NSCoding for SKTileGroup {}
283
284unsafe impl NSCopying for SKTileGroup {}
285
286unsafe impl CopyingHelper for SKTileGroup {
287    type Result = Self;
288}
289
290unsafe impl NSObjectProtocol for SKTileGroup {}
291
292unsafe impl NSSecureCoding for SKTileGroup {}
293
294impl SKTileGroup {
295    extern_methods!(
296        #[cfg(feature = "SKTileDefinition")]
297        /// 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.
298        ///
299        /// Parameter `tileDefinition`: the tile definition we wish to place in a tile map
300        #[unsafe(method(tileGroupWithTileDefinition:))]
301        #[unsafe(method_family = none)]
302        pub unsafe fn tileGroupWithTileDefinition(
303            tile_definition: &SKTileDefinition,
304        ) -> Retained<Self>;
305
306        /// Create a tile group with the specified rules.
307        ///
308        /// Parameter `rules`: the rules the group will use to determine tile placement
309        #[unsafe(method(tileGroupWithRules:))]
310        #[unsafe(method_family = none)]
311        pub unsafe fn tileGroupWithRules(rules: &NSArray<SKTileGroupRule>) -> Retained<Self>;
312
313        /// Create an empty tile group. Placing this in a tile map will erase the existing tile at that location.
314        #[unsafe(method(emptyTileGroup))]
315        #[unsafe(method_family = none)]
316        pub unsafe fn emptyTileGroup() -> Retained<Self>;
317
318        #[cfg(feature = "SKTileDefinition")]
319        /// 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.
320        ///
321        /// Parameter `tileDefinition`: tile definition we wish to place in a tile map
322        #[unsafe(method(initWithTileDefinition:))]
323        #[unsafe(method_family = init)]
324        pub unsafe fn initWithTileDefinition(
325            this: Allocated<Self>,
326            tile_definition: &SKTileDefinition,
327        ) -> Retained<Self>;
328
329        /// Initilize a tile group with the specified rules.
330        ///
331        /// Parameter `rules`: the rules the group will use to determine tile placement
332        #[unsafe(method(initWithRules:))]
333        #[unsafe(method_family = init)]
334        pub unsafe fn initWithRules(
335            this: Allocated<Self>,
336            rules: &NSArray<SKTileGroupRule>,
337        ) -> Retained<Self>;
338
339        /// The rules that govern which tiles are placed when this group is used, and where in the map they'll be placed.
340        #[unsafe(method(rules))]
341        #[unsafe(method_family = none)]
342        pub unsafe fn rules(&self) -> Retained<NSArray<SKTileGroupRule>>;
343
344        /// Setter for [`rules`][Self::rules].
345        #[unsafe(method(setRules:))]
346        #[unsafe(method_family = none)]
347        pub unsafe fn setRules(&self, rules: &NSArray<SKTileGroupRule>);
348
349        /// Client-assignable name for the tile group. Defaults to nil.
350        #[unsafe(method(name))]
351        #[unsafe(method_family = none)]
352        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
353
354        /// Setter for [`name`][Self::name].
355        #[unsafe(method(setName:))]
356        #[unsafe(method_family = none)]
357        pub unsafe fn setName(&self, name: Option<&NSString>);
358    );
359}
360
361/// Methods declared on superclass `NSObject`.
362impl SKTileGroup {
363    extern_methods!(
364        #[unsafe(method(init))]
365        #[unsafe(method_family = init)]
366        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
367
368        #[unsafe(method(new))]
369        #[unsafe(method_family = new)]
370        pub unsafe fn new() -> Retained<Self>;
371    );
372}
373
374extern_class!(
375    /// 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.
376    ///
377    /// See also [Apple's documentation](https://developer.apple.com/documentation/spritekit/sktilegrouprule?language=objc)
378    #[unsafe(super(NSObject))]
379    #[derive(Debug, PartialEq, Eq, Hash)]
380    pub struct SKTileGroupRule;
381);
382
383unsafe impl NSCoding for SKTileGroupRule {}
384
385unsafe impl NSCopying for SKTileGroupRule {}
386
387unsafe impl CopyingHelper for SKTileGroupRule {
388    type Result = Self;
389}
390
391unsafe impl NSObjectProtocol for SKTileGroupRule {}
392
393unsafe impl NSSecureCoding for SKTileGroupRule {}
394
395impl SKTileGroupRule {
396    extern_methods!(
397        #[cfg(feature = "SKTileDefinition")]
398        /// Create a tile group rule with the specified adjacency and tile definitions.
399        ///
400        /// 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
401        ///
402        /// Parameter `tileDefinitions`: the tile definitions used for this rule
403        #[unsafe(method(tileGroupRuleWithAdjacency:tileDefinitions:))]
404        #[unsafe(method_family = none)]
405        pub unsafe fn tileGroupRuleWithAdjacency_tileDefinitions(
406            adjacency: SKTileAdjacencyMask,
407            tile_definitions: &NSArray<SKTileDefinition>,
408        ) -> Retained<Self>;
409
410        #[cfg(feature = "SKTileDefinition")]
411        /// Initilize a tile group rule with the specified adjacency and tile definitions.
412        ///
413        /// 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
414        ///
415        /// Parameter `tileDefinitions`: the tile definitions used for this rule
416        #[unsafe(method(initWithAdjacency:tileDefinitions:))]
417        #[unsafe(method_family = init)]
418        pub unsafe fn initWithAdjacency_tileDefinitions(
419            this: Allocated<Self>,
420            adjacency: SKTileAdjacencyMask,
421            tile_definitions: &NSArray<SKTileDefinition>,
422        ) -> Retained<Self>;
423
424        /// 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.
425        #[unsafe(method(adjacency))]
426        #[unsafe(method_family = none)]
427        pub unsafe fn adjacency(&self) -> SKTileAdjacencyMask;
428
429        /// Setter for [`adjacency`][Self::adjacency].
430        #[unsafe(method(setAdjacency:))]
431        #[unsafe(method_family = none)]
432        pub unsafe fn setAdjacency(&self, adjacency: SKTileAdjacencyMask);
433
434        #[cfg(feature = "SKTileDefinition")]
435        /// 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.
436        #[unsafe(method(tileDefinitions))]
437        #[unsafe(method_family = none)]
438        pub unsafe fn tileDefinitions(&self) -> Retained<NSArray<SKTileDefinition>>;
439
440        #[cfg(feature = "SKTileDefinition")]
441        /// Setter for [`tileDefinitions`][Self::tileDefinitions].
442        #[unsafe(method(setTileDefinitions:))]
443        #[unsafe(method_family = none)]
444        pub unsafe fn setTileDefinitions(&self, tile_definitions: &NSArray<SKTileDefinition>);
445
446        /// Client-assignable name for the tile group rule. Defaults to nil.
447        #[unsafe(method(name))]
448        #[unsafe(method_family = none)]
449        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
450
451        /// Setter for [`name`][Self::name].
452        #[unsafe(method(setName:))]
453        #[unsafe(method_family = none)]
454        pub unsafe fn setName(&self, name: Option<&NSString>);
455    );
456}
457
458/// Methods declared on superclass `NSObject`.
459impl SKTileGroupRule {
460    extern_methods!(
461        #[unsafe(method(init))]
462        #[unsafe(method_family = init)]
463        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
464
465        #[unsafe(method(new))]
466        #[unsafe(method_family = new)]
467        pub unsafe fn new() -> Retained<Self>;
468    );
469}