objc2_gameplay_kit/generated/
GKBehavior.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(NSObject))]
16 #[derive(Debug, PartialEq, Eq, Hash)]
17 pub struct GKBehavior;
18);
19
20extern_conformance!(
21 unsafe impl NSCopying for GKBehavior {}
22);
23
24unsafe impl CopyingHelper for GKBehavior {
25 type Result = Self;
26}
27
28extern_conformance!(
29 unsafe impl NSFastEnumeration for GKBehavior {}
30);
31
32extern_conformance!(
33 unsafe impl NSObjectProtocol for GKBehavior {}
34);
35
36impl GKBehavior {
37 extern_methods!(
38 #[unsafe(method(goalCount))]
39 #[unsafe(method_family = none)]
40 pub unsafe fn goalCount(&self) -> NSInteger;
41
42 #[cfg(feature = "GKGoal")]
43 #[unsafe(method(behaviorWithGoal:weight:))]
45 #[unsafe(method_family = none)]
46 pub unsafe fn behaviorWithGoal_weight(goal: &GKGoal, weight: c_float) -> Retained<Self>;
47
48 #[cfg(feature = "GKGoal")]
49 #[unsafe(method(behaviorWithGoals:))]
51 #[unsafe(method_family = none)]
52 pub unsafe fn behaviorWithGoals(goals: &NSArray<GKGoal>) -> Retained<Self>;
53
54 #[cfg(feature = "GKGoal")]
55 #[unsafe(method(behaviorWithGoals:andWeights:))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn behaviorWithGoals_andWeights(
59 goals: &NSArray<GKGoal>,
60 weights: &NSArray<NSNumber>,
61 ) -> Retained<Self>;
62
63 #[cfg(feature = "GKGoal")]
64 #[unsafe(method(behaviorWithWeightedGoals:))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn behaviorWithWeightedGoals(
68 weighted_goals: &NSDictionary<GKGoal, NSNumber>,
69 ) -> Retained<Self>;
70
71 #[cfg(feature = "GKGoal")]
72 #[unsafe(method(setWeight:forGoal:))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn setWeight_forGoal(&self, weight: c_float, goal: &GKGoal);
81
82 #[cfg(feature = "GKGoal")]
83 #[unsafe(method(weightForGoal:))]
87 #[unsafe(method_family = none)]
88 pub unsafe fn weightForGoal(&self, goal: &GKGoal) -> c_float;
89
90 #[cfg(feature = "GKGoal")]
91 #[unsafe(method(removeGoal:))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn removeGoal(&self, goal: &GKGoal);
97
98 #[unsafe(method(removeAllGoals))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn removeAllGoals(&self);
102
103 #[cfg(feature = "GKGoal")]
104 #[unsafe(method(objectAtIndexedSubscript:))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn objectAtIndexedSubscript(&self, idx: NSUInteger) -> Retained<GKGoal>;
108
109 #[cfg(feature = "GKGoal")]
110 #[unsafe(method(setObject:forKeyedSubscript:))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn setObject_forKeyedSubscript(&self, weight: &NSNumber, goal: &GKGoal);
114
115 #[cfg(feature = "GKGoal")]
116 #[unsafe(method(objectForKeyedSubscript:))]
118 #[unsafe(method_family = none)]
119 pub unsafe fn objectForKeyedSubscript(&self, goal: &GKGoal) -> Option<Retained<NSNumber>>;
120 );
121}
122
123impl GKBehavior {
125 extern_methods!(
126 #[unsafe(method(init))]
127 #[unsafe(method_family = init)]
128 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
129
130 #[unsafe(method(new))]
131 #[unsafe(method_family = new)]
132 pub unsafe fn new() -> Retained<Self>;
133 );
134}