objc2-gameplay-kit 0.3.2

Bindings to the GameplayKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/gameplaykit/gkpath?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct GKPath;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for GKPath {}
);

impl GKPath {
    extern_methods!(
        /// Radius of the pathway.  Defines a spatial area that the path occupies.
        /// This can be though of as the union between rectangles between all points, and circles at each point
        #[unsafe(method(radius))]
        #[unsafe(method_family = none)]
        pub unsafe fn radius(&self) -> c_float;

        /// Setter for [`radius`][Self::radius].
        #[unsafe(method(setRadius:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRadius(&self, radius: c_float);

        /// Number of points in this path
        #[unsafe(method(numPoints))]
        #[unsafe(method_family = none)]
        pub unsafe fn numPoints(&self) -> NSUInteger;

        /// Does this path loop back on itself, creating a cycle?
        #[unsafe(method(isCyclical))]
        #[unsafe(method_family = none)]
        pub unsafe fn isCyclical(&self) -> bool;

        /// Setter for [`isCyclical`][Self::isCyclical].
        #[unsafe(method(setCyclical:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCyclical(&self, cyclical: bool);

        #[cfg(feature = "GKGraphNode")]
        /// Creates a path from an array of graph nodes (often a result of pathfinding)
        /// Accepts GKGraphNode2D and GKGraphNode3D
        /// Cyclical is set to NO
        ///
        /// Parameter `graphNodes`: an array of graph nodes to make a path from
        ///
        /// Parameter `radius`: radius of the path to create
        ///
        /// See: GKGraphNode
        #[unsafe(method(pathWithGraphNodes:radius:))]
        #[unsafe(method_family = none)]
        pub unsafe fn pathWithGraphNodes_radius(
            graph_nodes: &NSArray<GKGraphNode>,
            radius: c_float,
        ) -> Retained<Self>;

        #[cfg(feature = "GKGraphNode")]
        #[unsafe(method(initWithGraphNodes:radius:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithGraphNodes_radius(
            this: Allocated<Self>,
            graph_nodes: &NSArray<GKGraphNode>,
            radius: c_float,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
impl GKPath {
    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>;
    );
}