objc2_gameplay_kit/generated/
GKCompositeBehavior.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(GKBehavior, NSObject))]
13 #[derive(Debug, PartialEq, Eq, Hash)]
14 #[cfg(feature = "GKBehavior")]
15 pub struct GKCompositeBehavior;
16);
17
18#[cfg(feature = "GKBehavior")]
19extern_conformance!(
20 unsafe impl NSCopying for GKCompositeBehavior {}
21);
22
23#[cfg(feature = "GKBehavior")]
24unsafe impl CopyingHelper for GKCompositeBehavior {
25 type Result = Self;
26}
27
28#[cfg(feature = "GKBehavior")]
29extern_conformance!(
30 unsafe impl NSFastEnumeration for GKCompositeBehavior {}
31);
32
33#[cfg(feature = "GKBehavior")]
34extern_conformance!(
35 unsafe impl NSObjectProtocol for GKCompositeBehavior {}
36);
37
38#[cfg(feature = "GKBehavior")]
39impl GKCompositeBehavior {
40 extern_methods!(
41 #[unsafe(method(behaviorCount))]
43 #[unsafe(method_family = none)]
44 pub unsafe fn behaviorCount(&self) -> NSInteger;
45
46 #[unsafe(method(behaviorWithBehaviors:))]
48 #[unsafe(method_family = none)]
49 pub unsafe fn behaviorWithBehaviors(behaviors: &NSArray<GKBehavior>) -> Retained<Self>;
50
51 #[unsafe(method(behaviorWithBehaviors:andWeights:))]
53 #[unsafe(method_family = none)]
54 pub unsafe fn behaviorWithBehaviors_andWeights(
55 behaviors: &NSArray<GKBehavior>,
56 weights: &NSArray<NSNumber>,
57 ) -> Retained<Self>;
58
59 #[unsafe(method(setWeight:forBehavior:))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn setWeight_forBehavior(&self, weight: c_float, behavior: &GKBehavior);
68
69 #[unsafe(method(weightForBehavior:))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn weightForBehavior(&self, behavior: &GKBehavior) -> c_float;
75
76 #[unsafe(method(removeBehavior:))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn removeBehavior(&self, behavior: &GKBehavior);
82
83 #[unsafe(method(removeAllBehaviors))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn removeAllBehaviors(&self);
87
88 #[unsafe(method(objectAtIndexedSubscript:))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn objectAtIndexedSubscript(&self, idx: NSUInteger) -> Retained<GKBehavior>;
92
93 #[unsafe(method(setObject:forKeyedSubscript:))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn setObject_forKeyedSubscript(&self, weight: &NSNumber, behavior: &GKBehavior);
97
98 #[unsafe(method(objectForKeyedSubscript:))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn objectForKeyedSubscript(&self, behavior: &GKBehavior) -> Retained<NSNumber>;
102 );
103}
104
105#[cfg(feature = "GKBehavior")]
107impl GKCompositeBehavior {
108 extern_methods!(
109 #[cfg(feature = "GKGoal")]
110 #[unsafe(method(behaviorWithGoal:weight:))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn behaviorWithGoal_weight(goal: &GKGoal, weight: c_float) -> Retained<Self>;
114
115 #[cfg(feature = "GKGoal")]
116 #[unsafe(method(behaviorWithGoals:))]
118 #[unsafe(method_family = none)]
119 pub unsafe fn behaviorWithGoals(goals: &NSArray<GKGoal>) -> Retained<Self>;
120
121 #[cfg(feature = "GKGoal")]
122 #[unsafe(method(behaviorWithGoals:andWeights:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn behaviorWithGoals_andWeights(
126 goals: &NSArray<GKGoal>,
127 weights: &NSArray<NSNumber>,
128 ) -> Retained<Self>;
129
130 #[cfg(feature = "GKGoal")]
131 #[unsafe(method(behaviorWithWeightedGoals:))]
133 #[unsafe(method_family = none)]
134 pub unsafe fn behaviorWithWeightedGoals(
135 weighted_goals: &NSDictionary<GKGoal, NSNumber>,
136 ) -> Retained<Self>;
137 );
138}
139
140#[cfg(feature = "GKBehavior")]
142impl GKCompositeBehavior {
143 extern_methods!(
144 #[unsafe(method(init))]
145 #[unsafe(method_family = init)]
146 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
147
148 #[unsafe(method(new))]
149 #[unsafe(method_family = new)]
150 pub unsafe fn new() -> Retained<Self>;
151 );
152}