use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(GKGraph, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "GKGraph", feature = "GKGraphNode"))]
pub struct GKGridGraph<NodeType: ?Sized = AnyObject>;
);
#[cfg(all(feature = "GKGraph", feature = "GKGraphNode"))]
impl<NodeType: ?Sized + Message + AsRef<GKGridGraphNode>> GKGridGraph<NodeType> {
#[inline]
pub unsafe fn cast_unchecked<NewNodeType: ?Sized + Message + AsRef<GKGridGraphNode>>(
&self,
) -> &GKGridGraph<NewNodeType> {
unsafe { &*((self as *const Self).cast()) }
}
}
#[cfg(all(feature = "GKGraph", feature = "GKGraphNode"))]
extern_conformance!(
unsafe impl<NodeType: ?Sized + NSCoding + AsRef<GKGridGraphNode>> NSCoding
for GKGridGraph<NodeType>
{
}
);
#[cfg(all(feature = "GKGraph", feature = "GKGraphNode"))]
extern_conformance!(
unsafe impl<NodeType: ?Sized + AsRef<GKGridGraphNode>> NSCopying for GKGridGraph<NodeType> {}
);
#[cfg(all(feature = "GKGraph", feature = "GKGraphNode"))]
unsafe impl<NodeType: ?Sized + Message + AsRef<GKGridGraphNode>> CopyingHelper
for GKGridGraph<NodeType>
{
type Result = Self;
}
#[cfg(all(feature = "GKGraph", feature = "GKGraphNode"))]
extern_conformance!(
unsafe impl<NodeType: ?Sized + AsRef<GKGridGraphNode>> NSObjectProtocol for GKGridGraph<NodeType> {}
);
#[cfg(all(feature = "GKGraph", feature = "GKGraphNode"))]
extern_conformance!(
unsafe impl<NodeType: ?Sized + NSSecureCoding + AsRef<GKGridGraphNode>> NSSecureCoding
for GKGridGraph<NodeType>
{
}
);
#[cfg(all(feature = "GKGraph", feature = "GKGraphNode"))]
impl<NodeType: Message + AsRef<GKGridGraphNode>> GKGridGraph<NodeType> {
extern_methods!(
#[unsafe(method(gridWidth))]
#[unsafe(method_family = none)]
pub unsafe fn gridWidth(&self) -> NSUInteger;
#[unsafe(method(gridHeight))]
#[unsafe(method_family = none)]
pub unsafe fn gridHeight(&self) -> NSUInteger;
#[unsafe(method(diagonalsAllowed))]
#[unsafe(method_family = none)]
pub unsafe fn diagonalsAllowed(&self) -> bool;
#[unsafe(method(connectNodeToAdjacentNodes:))]
#[unsafe(method_family = none)]
pub unsafe fn connectNodeToAdjacentNodes(&self, node: &GKGridGraphNode);
#[unsafe(method(classForGenericArgumentAtIndex:))]
#[unsafe(method_family = none)]
pub unsafe fn classForGenericArgumentAtIndex(&self, index: NSUInteger)
-> &'static AnyClass;
);
}
#[cfg(all(feature = "GKGraph", feature = "GKGraphNode"))]
impl<NodeType: Message + AsRef<GKGridGraphNode>> GKGridGraph<NodeType> {
extern_methods!(
#[unsafe(method(graphWithNodes:))]
#[unsafe(method_family = none)]
pub unsafe fn graphWithNodes(nodes: &NSArray<GKGraphNode>) -> Retained<Self>;
#[unsafe(method(initWithNodes:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithNodes(
this: Allocated<Self>,
nodes: &NSArray<GKGraphNode>,
) -> Retained<Self>;
);
}
#[cfg(all(feature = "GKGraph", feature = "GKGraphNode"))]
impl<NodeType: Message + AsRef<GKGridGraphNode>> GKGridGraph<NodeType> {
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>;
);
}