use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct SKTileSetType(pub NSUInteger);
impl SKTileSetType {
#[doc(alias = "SKTileSetTypeGrid")]
pub const Grid: Self = Self(0);
#[doc(alias = "SKTileSetTypeIsometric")]
pub const Isometric: Self = Self(1);
#[doc(alias = "SKTileSetTypeHexagonalFlat")]
pub const HexagonalFlat: Self = Self(2);
#[doc(alias = "SKTileSetTypeHexagonalPointy")]
pub const HexagonalPointy: Self = Self(3);
}
unsafe impl Encode for SKTileSetType {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for SKTileSetType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct SKTileAdjacencyMask(pub NSUInteger);
bitflags::bitflags! {
impl SKTileAdjacencyMask: NSUInteger {
#[doc(alias = "SKTileAdjacencyUp")]
const AdjacencyUp = 1<<0;
#[doc(alias = "SKTileAdjacencyUpperRight")]
const AdjacencyUpperRight = 1<<1;
#[doc(alias = "SKTileAdjacencyRight")]
const AdjacencyRight = 1<<2;
#[doc(alias = "SKTileAdjacencyLowerRight")]
const AdjacencyLowerRight = 1<<3;
#[doc(alias = "SKTileAdjacencyDown")]
const AdjacencyDown = 1<<4;
#[doc(alias = "SKTileAdjacencyLowerLeft")]
const AdjacencyLowerLeft = 1<<5;
#[doc(alias = "SKTileAdjacencyLeft")]
const AdjacencyLeft = 1<<6;
#[doc(alias = "SKTileAdjacencyUpperLeft")]
const AdjacencyUpperLeft = 1<<7;
#[doc(alias = "SKTileAdjacencyAll")]
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;
#[doc(alias = "SKTileHexFlatAdjacencyUp")]
const HexFlatAdjacencyUp = 1<<0;
#[doc(alias = "SKTileHexFlatAdjacencyUpperRight")]
const HexFlatAdjacencyUpperRight = 1<<1;
#[doc(alias = "SKTileHexFlatAdjacencyLowerRight")]
const HexFlatAdjacencyLowerRight = 1<<2;
#[doc(alias = "SKTileHexFlatAdjacencyDown")]
const HexFlatAdjacencyDown = 1<<3;
#[doc(alias = "SKTileHexFlatAdjacencyLowerLeft")]
const HexFlatAdjacencyLowerLeft = 1<<4;
#[doc(alias = "SKTileHexFlatAdjacencyUpperLeft")]
const HexFlatAdjacencyUpperLeft = 1<<5;
#[doc(alias = "SKTileHexFlatAdjacencyAll")]
const HexFlatAdjacencyAll = SKTileAdjacencyMask::HexFlatAdjacencyUp.0|SKTileAdjacencyMask::HexFlatAdjacencyUpperRight.0|SKTileAdjacencyMask::HexFlatAdjacencyLowerRight.0|SKTileAdjacencyMask::HexFlatAdjacencyDown.0|SKTileAdjacencyMask::HexFlatAdjacencyLowerLeft.0|SKTileAdjacencyMask::HexFlatAdjacencyUpperLeft.0;
#[doc(alias = "SKTileHexPointyAdjacencyUpperLeft")]
const HexPointyAdjacencyUpperLeft = 1<<0;
#[doc(alias = "SKTileHexPointyAdjacencyUpperRight")]
const HexPointyAdjacencyUpperRight = 1<<1;
#[doc(alias = "SKTileHexPointyAdjacencyRight")]
const HexPointyAdjacencyRight = 1<<2;
#[doc(alias = "SKTileHexPointyAdjacencyLowerRight")]
const HexPointyAdjacencyLowerRight = 1<<3;
#[doc(alias = "SKTileHexPointyAdjacencyLowerLeft")]
const HexPointyAdjacencyLowerLeft = 1<<4;
#[doc(alias = "SKTileHexPointyAdjacencyLeft")]
const HexPointyAdjacencyLeft = 1<<5;
#[doc(alias = "SKTileHexPointyAdjacencyAdd")]
const HexPointyAdjacencyAdd = SKTileAdjacencyMask::HexPointyAdjacencyUpperLeft.0|SKTileAdjacencyMask::HexPointyAdjacencyUpperRight.0|SKTileAdjacencyMask::HexPointyAdjacencyRight.0|SKTileAdjacencyMask::HexPointyAdjacencyLowerRight.0|SKTileAdjacencyMask::HexPointyAdjacencyLowerLeft.0|SKTileAdjacencyMask::HexPointyAdjacencyLeft.0;
#[doc(alias = "SKTileAdjacencyUpEdge")]
const AdjacencyUpEdge = SKTileAdjacencyMask::AdjacencyRight.0|SKTileAdjacencyMask::AdjacencyLowerRight.0|SKTileAdjacencyMask::AdjacencyDown.0|SKTileAdjacencyMask::AdjacencyLowerLeft.0|SKTileAdjacencyMask::AdjacencyLeft.0;
#[doc(alias = "SKTileAdjacencyUpperRightEdge")]
const AdjacencyUpperRightEdge = SKTileAdjacencyMask::AdjacencyDown.0|SKTileAdjacencyMask::AdjacencyLowerLeft.0|SKTileAdjacencyMask::AdjacencyLeft.0;
#[doc(alias = "SKTileAdjacencyRightEdge")]
const AdjacencyRightEdge = SKTileAdjacencyMask::AdjacencyDown.0|SKTileAdjacencyMask::AdjacencyLowerLeft.0|SKTileAdjacencyMask::AdjacencyLeft.0|SKTileAdjacencyMask::AdjacencyUpperLeft.0|SKTileAdjacencyMask::AdjacencyUp.0;
#[doc(alias = "SKTileAdjacencyLowerRightEdge")]
const AdjacencyLowerRightEdge = SKTileAdjacencyMask::AdjacencyLeft.0|SKTileAdjacencyMask::AdjacencyUpperLeft.0|SKTileAdjacencyMask::AdjacencyUp.0;
#[doc(alias = "SKTileAdjacencyDownEdge")]
const AdjacencyDownEdge = SKTileAdjacencyMask::AdjacencyUp.0|SKTileAdjacencyMask::AdjacencyUpperRight.0|SKTileAdjacencyMask::AdjacencyRight.0|SKTileAdjacencyMask::AdjacencyLeft.0|SKTileAdjacencyMask::AdjacencyUpperLeft.0;
#[doc(alias = "SKTileAdjacencyLowerLeftEdge")]
const AdjacencyLowerLeftEdge = SKTileAdjacencyMask::AdjacencyUp.0|SKTileAdjacencyMask::AdjacencyUpperRight.0|SKTileAdjacencyMask::AdjacencyRight.0;
#[doc(alias = "SKTileAdjacencyLeftEdge")]
const AdjacencyLeftEdge = SKTileAdjacencyMask::AdjacencyUp.0|SKTileAdjacencyMask::AdjacencyUpperRight.0|SKTileAdjacencyMask::AdjacencyRight.0|SKTileAdjacencyMask::AdjacencyLowerRight.0|SKTileAdjacencyMask::AdjacencyDown.0;
#[doc(alias = "SKTileAdjacencyUpperLeftEdge")]
const AdjacencyUpperLeftEdge = SKTileAdjacencyMask::AdjacencyRight.0|SKTileAdjacencyMask::AdjacencyLowerRight.0|SKTileAdjacencyMask::AdjacencyDown.0;
#[doc(alias = "SKTileAdjacencyUpperRightCorner")]
const AdjacencyUpperRightCorner = SKTileAdjacencyMask::AdjacencyUp.0|SKTileAdjacencyMask::AdjacencyUpperRight.0|SKTileAdjacencyMask::AdjacencyRight.0|SKTileAdjacencyMask::AdjacencyLowerRight.0|SKTileAdjacencyMask::AdjacencyDown.0|SKTileAdjacencyMask::AdjacencyLeft.0|SKTileAdjacencyMask::AdjacencyUpperLeft.0;
#[doc(alias = "SKTileAdjacencyLowerRightCorner")]
const AdjacencyLowerRightCorner = SKTileAdjacencyMask::AdjacencyUp.0|SKTileAdjacencyMask::AdjacencyUpperRight.0|SKTileAdjacencyMask::AdjacencyRight.0|SKTileAdjacencyMask::AdjacencyLowerRight.0|SKTileAdjacencyMask::AdjacencyDown.0|SKTileAdjacencyMask::AdjacencyLowerLeft.0|SKTileAdjacencyMask::AdjacencyLeft.0;
#[doc(alias = "SKTileAdjacencyLowerLeftCorner")]
const AdjacencyLowerLeftCorner = SKTileAdjacencyMask::AdjacencyUp.0|SKTileAdjacencyMask::AdjacencyRight.0|SKTileAdjacencyMask::AdjacencyLowerRight.0|SKTileAdjacencyMask::AdjacencyDown.0|SKTileAdjacencyMask::AdjacencyLowerLeft.0|SKTileAdjacencyMask::AdjacencyLeft.0|SKTileAdjacencyMask::AdjacencyUpperLeft.0;
#[doc(alias = "SKTileAdjacencyUpperLeftCorner")]
const AdjacencyUpperLeftCorner = SKTileAdjacencyMask::AdjacencyUp.0|SKTileAdjacencyMask::AdjacencyUpperRight.0|SKTileAdjacencyMask::AdjacencyRight.0|SKTileAdjacencyMask::AdjacencyDown.0|SKTileAdjacencyMask::AdjacencyLowerLeft.0|SKTileAdjacencyMask::AdjacencyLeft.0|SKTileAdjacencyMask::AdjacencyUpperLeft.0;
}
}
unsafe impl Encode for SKTileAdjacencyMask {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for SKTileAdjacencyMask {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct SKTileSet;
);
extern_conformance!(
unsafe impl NSCoding for SKTileSet {}
);
extern_conformance!(
unsafe impl NSCopying for SKTileSet {}
);
unsafe impl CopyingHelper for SKTileSet {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for SKTileSet {}
);
extern_conformance!(
unsafe impl NSSecureCoding for SKTileSet {}
);
impl SKTileSet {
extern_methods!(
#[unsafe(method(tileSetWithTileGroups:))]
#[unsafe(method_family = none)]
pub unsafe fn tileSetWithTileGroups(tile_groups: &NSArray<SKTileGroup>) -> Retained<Self>;
#[unsafe(method(tileSetWithTileGroups:tileSetType:))]
#[unsafe(method_family = none)]
pub unsafe fn tileSetWithTileGroups_tileSetType(
tile_groups: &NSArray<SKTileGroup>,
tile_set_type: SKTileSetType,
) -> Retained<Self>;
#[unsafe(method(initWithTileGroups:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithTileGroups(
this: Allocated<Self>,
tile_groups: &NSArray<SKTileGroup>,
) -> Retained<Self>;
#[unsafe(method(initWithTileGroups:tileSetType:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithTileGroups_tileSetType(
this: Allocated<Self>,
tile_groups: &NSArray<SKTileGroup>,
tile_set_type: SKTileSetType,
) -> Retained<Self>;
#[unsafe(method(tileSetNamed:))]
#[unsafe(method_family = none)]
pub unsafe fn tileSetNamed(name: &NSString) -> Option<Retained<Self>>;
#[unsafe(method(tileSetFromURL:))]
#[unsafe(method_family = none)]
pub unsafe fn tileSetFromURL(url: &NSURL) -> Option<Retained<Self>>;
#[unsafe(method(tileGroups))]
#[unsafe(method_family = none)]
pub unsafe fn tileGroups(&self) -> Retained<NSArray<SKTileGroup>>;
#[unsafe(method(setTileGroups:))]
#[unsafe(method_family = none)]
pub unsafe fn setTileGroups(&self, tile_groups: &NSArray<SKTileGroup>);
#[unsafe(method(name))]
#[unsafe(method_family = none)]
pub unsafe fn name(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setName:))]
#[unsafe(method_family = none)]
pub unsafe fn setName(&self, name: Option<&NSString>);
#[unsafe(method(type))]
#[unsafe(method_family = none)]
pub unsafe fn r#type(&self) -> SKTileSetType;
#[unsafe(method(setType:))]
#[unsafe(method_family = none)]
pub unsafe fn setType(&self, r#type: SKTileSetType);
#[unsafe(method(defaultTileGroup))]
#[unsafe(method_family = none)]
pub unsafe fn defaultTileGroup(&self) -> Option<Retained<SKTileGroup>>;
#[unsafe(method(setDefaultTileGroup:))]
#[unsafe(method_family = none)]
pub unsafe fn setDefaultTileGroup(&self, default_tile_group: Option<&SKTileGroup>);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(defaultTileSize))]
#[unsafe(method_family = none)]
pub unsafe fn defaultTileSize(&self) -> CGSize;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setDefaultTileSize:))]
#[unsafe(method_family = none)]
pub unsafe fn setDefaultTileSize(&self, default_tile_size: CGSize);
);
}
impl SKTileSet {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct SKTileGroup;
);
extern_conformance!(
unsafe impl NSCoding for SKTileGroup {}
);
extern_conformance!(
unsafe impl NSCopying for SKTileGroup {}
);
unsafe impl CopyingHelper for SKTileGroup {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for SKTileGroup {}
);
extern_conformance!(
unsafe impl NSSecureCoding for SKTileGroup {}
);
impl SKTileGroup {
extern_methods!(
#[cfg(feature = "SKTileDefinition")]
#[unsafe(method(tileGroupWithTileDefinition:))]
#[unsafe(method_family = none)]
pub unsafe fn tileGroupWithTileDefinition(
tile_definition: &SKTileDefinition,
) -> Retained<Self>;
#[unsafe(method(tileGroupWithRules:))]
#[unsafe(method_family = none)]
pub unsafe fn tileGroupWithRules(rules: &NSArray<SKTileGroupRule>) -> Retained<Self>;
#[unsafe(method(emptyTileGroup))]
#[unsafe(method_family = none)]
pub unsafe fn emptyTileGroup() -> Retained<Self>;
#[cfg(feature = "SKTileDefinition")]
#[unsafe(method(initWithTileDefinition:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithTileDefinition(
this: Allocated<Self>,
tile_definition: &SKTileDefinition,
) -> Retained<Self>;
#[unsafe(method(initWithRules:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithRules(
this: Allocated<Self>,
rules: &NSArray<SKTileGroupRule>,
) -> Retained<Self>;
#[unsafe(method(rules))]
#[unsafe(method_family = none)]
pub unsafe fn rules(&self) -> Retained<NSArray<SKTileGroupRule>>;
#[unsafe(method(setRules:))]
#[unsafe(method_family = none)]
pub unsafe fn setRules(&self, rules: &NSArray<SKTileGroupRule>);
#[unsafe(method(name))]
#[unsafe(method_family = none)]
pub unsafe fn name(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setName:))]
#[unsafe(method_family = none)]
pub unsafe fn setName(&self, name: Option<&NSString>);
);
}
impl SKTileGroup {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct SKTileGroupRule;
);
extern_conformance!(
unsafe impl NSCoding for SKTileGroupRule {}
);
extern_conformance!(
unsafe impl NSCopying for SKTileGroupRule {}
);
unsafe impl CopyingHelper for SKTileGroupRule {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for SKTileGroupRule {}
);
extern_conformance!(
unsafe impl NSSecureCoding for SKTileGroupRule {}
);
impl SKTileGroupRule {
extern_methods!(
#[cfg(feature = "SKTileDefinition")]
#[unsafe(method(tileGroupRuleWithAdjacency:tileDefinitions:))]
#[unsafe(method_family = none)]
pub unsafe fn tileGroupRuleWithAdjacency_tileDefinitions(
adjacency: SKTileAdjacencyMask,
tile_definitions: &NSArray<SKTileDefinition>,
) -> Retained<Self>;
#[cfg(feature = "SKTileDefinition")]
#[unsafe(method(initWithAdjacency:tileDefinitions:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithAdjacency_tileDefinitions(
this: Allocated<Self>,
adjacency: SKTileAdjacencyMask,
tile_definitions: &NSArray<SKTileDefinition>,
) -> Retained<Self>;
#[unsafe(method(adjacency))]
#[unsafe(method_family = none)]
pub unsafe fn adjacency(&self) -> SKTileAdjacencyMask;
#[unsafe(method(setAdjacency:))]
#[unsafe(method_family = none)]
pub unsafe fn setAdjacency(&self, adjacency: SKTileAdjacencyMask);
#[cfg(feature = "SKTileDefinition")]
#[unsafe(method(tileDefinitions))]
#[unsafe(method_family = none)]
pub unsafe fn tileDefinitions(&self) -> Retained<NSArray<SKTileDefinition>>;
#[cfg(feature = "SKTileDefinition")]
#[unsafe(method(setTileDefinitions:))]
#[unsafe(method_family = none)]
pub unsafe fn setTileDefinitions(&self, tile_definitions: &NSArray<SKTileDefinition>);
#[unsafe(method(name))]
#[unsafe(method_family = none)]
pub unsafe fn name(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setName:))]
#[unsafe(method_family = none)]
pub unsafe fn setName(&self, name: Option<&NSString>);
);
}
impl SKTileGroupRule {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}