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        ///
222        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
223        #[unsafe(method(setTileGroups:))]
224        #[unsafe(method_family = none)]
225        pub unsafe fn setTileGroups(&self, tile_groups: &NSArray<SKTileGroup>);
226
227        /// Client-assignable name for the tile set. Defaults to nil.
228        #[unsafe(method(name))]
229        #[unsafe(method_family = none)]
230        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
231
232        /// Setter for [`name`][Self::name].
233        ///
234        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
235        #[unsafe(method(setName:))]
236        #[unsafe(method_family = none)]
237        pub unsafe fn setName(&self, name: Option<&NSString>);
238
239        /// The tile set type specifies how the tiles in the set will be arranged when placed in a tile map. Defaults to SKTileSetTypeGrid.
240        #[unsafe(method(type))]
241        #[unsafe(method_family = none)]
242        pub unsafe fn r#type(&self) -> SKTileSetType;
243
244        /// Setter for [`type`][Self::type].
245        #[unsafe(method(setType:))]
246        #[unsafe(method_family = none)]
247        pub unsafe fn setType(&self, r#type: SKTileSetType);
248
249        #[unsafe(method(defaultTileGroup))]
250        #[unsafe(method_family = none)]
251        pub unsafe fn defaultTileGroup(&self) -> Option<Retained<SKTileGroup>>;
252
253        /// Setter for [`defaultTileGroup`][Self::defaultTileGroup].
254        #[unsafe(method(setDefaultTileGroup:))]
255        #[unsafe(method_family = none)]
256        pub unsafe fn setDefaultTileGroup(&self, default_tile_group: Option<&SKTileGroup>);
257
258        #[cfg(feature = "objc2-core-foundation")]
259        /// The default tile size is the value an SKTileMapNode will use for it's tiles when the tile set is assigned to it.
260        #[unsafe(method(defaultTileSize))]
261        #[unsafe(method_family = none)]
262        pub unsafe fn defaultTileSize(&self) -> CGSize;
263
264        #[cfg(feature = "objc2-core-foundation")]
265        /// Setter for [`defaultTileSize`][Self::defaultTileSize].
266        #[unsafe(method(setDefaultTileSize:))]
267        #[unsafe(method_family = none)]
268        pub unsafe fn setDefaultTileSize(&self, default_tile_size: CGSize);
269    );
270}
271
272/// Methods declared on superclass `NSObject`.
273impl SKTileSet {
274    extern_methods!(
275        #[unsafe(method(init))]
276        #[unsafe(method_family = init)]
277        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
278
279        #[unsafe(method(new))]
280        #[unsafe(method_family = new)]
281        pub unsafe fn new() -> Retained<Self>;
282    );
283}
284
285extern_class!(
286    /// 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.
287    ///
288    /// See also [Apple's documentation](https://developer.apple.com/documentation/spritekit/sktilegroup?language=objc)
289    #[unsafe(super(NSObject))]
290    #[derive(Debug, PartialEq, Eq, Hash)]
291    pub struct SKTileGroup;
292);
293
294extern_conformance!(
295    unsafe impl NSCoding for SKTileGroup {}
296);
297
298extern_conformance!(
299    unsafe impl NSCopying for SKTileGroup {}
300);
301
302unsafe impl CopyingHelper for SKTileGroup {
303    type Result = Self;
304}
305
306extern_conformance!(
307    unsafe impl NSObjectProtocol for SKTileGroup {}
308);
309
310extern_conformance!(
311    unsafe impl NSSecureCoding for SKTileGroup {}
312);
313
314impl SKTileGroup {
315    extern_methods!(
316        #[cfg(feature = "SKTileDefinition")]
317        /// 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.
318        ///
319        /// Parameter `tileDefinition`: the tile definition we wish to place in a tile map
320        #[unsafe(method(tileGroupWithTileDefinition:))]
321        #[unsafe(method_family = none)]
322        pub unsafe fn tileGroupWithTileDefinition(
323            tile_definition: &SKTileDefinition,
324        ) -> Retained<Self>;
325
326        /// Create a tile group with the specified rules.
327        ///
328        /// Parameter `rules`: the rules the group will use to determine tile placement
329        #[unsafe(method(tileGroupWithRules:))]
330        #[unsafe(method_family = none)]
331        pub unsafe fn tileGroupWithRules(rules: &NSArray<SKTileGroupRule>) -> Retained<Self>;
332
333        /// Create an empty tile group. Placing this in a tile map will erase the existing tile at that location.
334        #[unsafe(method(emptyTileGroup))]
335        #[unsafe(method_family = none)]
336        pub unsafe fn emptyTileGroup() -> Retained<Self>;
337
338        #[cfg(feature = "SKTileDefinition")]
339        /// 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.
340        ///
341        /// Parameter `tileDefinition`: tile definition we wish to place in a tile map
342        #[unsafe(method(initWithTileDefinition:))]
343        #[unsafe(method_family = init)]
344        pub unsafe fn initWithTileDefinition(
345            this: Allocated<Self>,
346            tile_definition: &SKTileDefinition,
347        ) -> Retained<Self>;
348
349        /// Initilize a tile group with the specified rules.
350        ///
351        /// Parameter `rules`: the rules the group will use to determine tile placement
352        #[unsafe(method(initWithRules:))]
353        #[unsafe(method_family = init)]
354        pub unsafe fn initWithRules(
355            this: Allocated<Self>,
356            rules: &NSArray<SKTileGroupRule>,
357        ) -> Retained<Self>;
358
359        /// The rules that govern which tiles are placed when this group is used, and where in the map they'll be placed.
360        #[unsafe(method(rules))]
361        #[unsafe(method_family = none)]
362        pub unsafe fn rules(&self) -> Retained<NSArray<SKTileGroupRule>>;
363
364        /// Setter for [`rules`][Self::rules].
365        ///
366        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
367        #[unsafe(method(setRules:))]
368        #[unsafe(method_family = none)]
369        pub unsafe fn setRules(&self, rules: &NSArray<SKTileGroupRule>);
370
371        /// Client-assignable name for the tile group. Defaults to nil.
372        #[unsafe(method(name))]
373        #[unsafe(method_family = none)]
374        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
375
376        /// Setter for [`name`][Self::name].
377        ///
378        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
379        #[unsafe(method(setName:))]
380        #[unsafe(method_family = none)]
381        pub unsafe fn setName(&self, name: Option<&NSString>);
382    );
383}
384
385/// Methods declared on superclass `NSObject`.
386impl SKTileGroup {
387    extern_methods!(
388        #[unsafe(method(init))]
389        #[unsafe(method_family = init)]
390        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
391
392        #[unsafe(method(new))]
393        #[unsafe(method_family = new)]
394        pub unsafe fn new() -> Retained<Self>;
395    );
396}
397
398extern_class!(
399    /// 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.
400    ///
401    /// See also [Apple's documentation](https://developer.apple.com/documentation/spritekit/sktilegrouprule?language=objc)
402    #[unsafe(super(NSObject))]
403    #[derive(Debug, PartialEq, Eq, Hash)]
404    pub struct SKTileGroupRule;
405);
406
407extern_conformance!(
408    unsafe impl NSCoding for SKTileGroupRule {}
409);
410
411extern_conformance!(
412    unsafe impl NSCopying for SKTileGroupRule {}
413);
414
415unsafe impl CopyingHelper for SKTileGroupRule {
416    type Result = Self;
417}
418
419extern_conformance!(
420    unsafe impl NSObjectProtocol for SKTileGroupRule {}
421);
422
423extern_conformance!(
424    unsafe impl NSSecureCoding for SKTileGroupRule {}
425);
426
427impl SKTileGroupRule {
428    extern_methods!(
429        #[cfg(feature = "SKTileDefinition")]
430        /// Create a tile group rule with the specified adjacency and tile definitions.
431        ///
432        /// 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
433        ///
434        /// Parameter `tileDefinitions`: the tile definitions used for this rule
435        #[unsafe(method(tileGroupRuleWithAdjacency:tileDefinitions:))]
436        #[unsafe(method_family = none)]
437        pub unsafe fn tileGroupRuleWithAdjacency_tileDefinitions(
438            adjacency: SKTileAdjacencyMask,
439            tile_definitions: &NSArray<SKTileDefinition>,
440        ) -> Retained<Self>;
441
442        #[cfg(feature = "SKTileDefinition")]
443        /// Initilize a tile group rule with the specified adjacency and tile definitions.
444        ///
445        /// 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
446        ///
447        /// Parameter `tileDefinitions`: the tile definitions used for this rule
448        #[unsafe(method(initWithAdjacency:tileDefinitions:))]
449        #[unsafe(method_family = init)]
450        pub unsafe fn initWithAdjacency_tileDefinitions(
451            this: Allocated<Self>,
452            adjacency: SKTileAdjacencyMask,
453            tile_definitions: &NSArray<SKTileDefinition>,
454        ) -> Retained<Self>;
455
456        /// 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.
457        #[unsafe(method(adjacency))]
458        #[unsafe(method_family = none)]
459        pub unsafe fn adjacency(&self) -> SKTileAdjacencyMask;
460
461        /// Setter for [`adjacency`][Self::adjacency].
462        #[unsafe(method(setAdjacency:))]
463        #[unsafe(method_family = none)]
464        pub unsafe fn setAdjacency(&self, adjacency: SKTileAdjacencyMask);
465
466        #[cfg(feature = "SKTileDefinition")]
467        /// 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.
468        #[unsafe(method(tileDefinitions))]
469        #[unsafe(method_family = none)]
470        pub unsafe fn tileDefinitions(&self) -> Retained<NSArray<SKTileDefinition>>;
471
472        #[cfg(feature = "SKTileDefinition")]
473        /// Setter for [`tileDefinitions`][Self::tileDefinitions].
474        ///
475        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
476        #[unsafe(method(setTileDefinitions:))]
477        #[unsafe(method_family = none)]
478        pub unsafe fn setTileDefinitions(&self, tile_definitions: &NSArray<SKTileDefinition>);
479
480        /// Client-assignable name for the tile group rule. Defaults to nil.
481        #[unsafe(method(name))]
482        #[unsafe(method_family = none)]
483        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
484
485        /// Setter for [`name`][Self::name].
486        ///
487        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
488        #[unsafe(method(setName:))]
489        #[unsafe(method_family = none)]
490        pub unsafe fn setName(&self, name: Option<&NSString>);
491    );
492}
493
494/// Methods declared on superclass `NSObject`.
495impl SKTileGroupRule {
496    extern_methods!(
497        #[unsafe(method(init))]
498        #[unsafe(method_family = init)]
499        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
500
501        #[unsafe(method(new))]
502        #[unsafe(method_family = new)]
503        pub unsafe fn new() -> Retained<Self>;
504    );
505}