reactive_graph_flow_model/reactive_graph/flow/
flow_3_d.rs1#![allow(dead_code, unused)]
5#![cfg_attr(rustfmt, rustfmt_skip)]
6
7#[cfg_attr(rustfmt, rustfmt_skip)]
9pub const FLOW_3_D_NAMESPACE: &str = "reactive_graph::flow::Flow3D";
10
11pub static FLOW_3_D: std::sync::LazyLock<reactive_graph_graph::ComponentTypeId> = std::sync::LazyLock::new(||
18std::str::FromStr::from_str(FLOW_3_D_NAMESPACE).unwrap());
19
20#[allow(non_camel_case_types)]
22#[derive(Debug, PartialEq, PartialOrd, Eq, Hash, Clone)]
23pub enum Flow3DProperties {
24
25 F_3_DD,
36
37 F_3_DH,
48
49 F_3_DW,
60
61 F_3_DX,
72
73 F_3_DY,
84
85 F_3_DZ,
96}
97impl Flow3DProperties {
98 pub fn len() -> usize {
99 6usize
100 }
101
102 pub fn property_types() -> reactive_graph_graph::PropertyTypes {
103 let property_types = reactive_graph_graph::PropertyTypes::new();
104 property_types.push(Flow3DProperties::F_3_DD);
105 property_types.push(Flow3DProperties::F_3_DH);
106 property_types.push(Flow3DProperties::F_3_DW);
107 property_types.push(Flow3DProperties::F_3_DX);
108 property_types.push(Flow3DProperties::F_3_DY);
109 property_types.push(Flow3DProperties::F_3_DZ);
110 property_types
111 }
112}
113
114impl AsRef<str> for Flow3DProperties {
115 #[inline]
116 fn as_ref(&self) -> &str {
117 match *self {
118 Flow3DProperties::F_3_DD => "f3dd",
119 Flow3DProperties::F_3_DH => "f3dh",
120 Flow3DProperties::F_3_DW => "f3dw",
121 Flow3DProperties::F_3_DX => "f3dx",
122 Flow3DProperties::F_3_DY => "f3dy",
123 Flow3DProperties::F_3_DZ => "f3dz",
124 }
125 }
126}
127
128impl From<Flow3DProperties> for &'static str {
129 #[inline]
130 fn from(properties: Flow3DProperties) -> &'static str {
131 match properties {
132 Flow3DProperties::F_3_DD => "f3dd",
133 Flow3DProperties::F_3_DH => "f3dh",
134 Flow3DProperties::F_3_DW => "f3dw",
135 Flow3DProperties::F_3_DX => "f3dx",
136 Flow3DProperties::F_3_DY => "f3dy",
137 Flow3DProperties::F_3_DZ => "f3dz",
138 }
139 }
140}
141
142impl From<Flow3DProperties> for String {
143 #[inline]
144 fn from(properties: Flow3DProperties) -> String {
145 match properties {
146 Flow3DProperties::F_3_DD => "f3dd".to_owned(),
147 Flow3DProperties::F_3_DH => "f3dh".to_owned(),
148 Flow3DProperties::F_3_DW => "f3dw".to_owned(),
149 Flow3DProperties::F_3_DX => "f3dx".to_owned(),
150 Flow3DProperties::F_3_DY => "f3dy".to_owned(),
151 Flow3DProperties::F_3_DZ => "f3dz".to_owned(),
152 }
153 }
154}
155
156impl From<Flow3DProperties> for reactive_graph_graph::PropertyType {
157 #[inline]
158 fn from(properties: Flow3DProperties) -> reactive_graph_graph::PropertyType {
159 match properties {
160 Flow3DProperties::F_3_DD => {
161 reactive_graph_graph::PropertyType::new_with_all(
162 "f3dd",
163 "The depth (z-axis) in a 3D flow",
164 reactive_graph_graph::DataType::Number,
165 reactive_graph_graph::SocketType::None,
166 reactive_graph_graph::Mutability::Mutable,
167 reactive_graph_graph::Extensions::new(),
168 )
169 }
170 Flow3DProperties::F_3_DH => {
171 reactive_graph_graph::PropertyType::new_with_all(
172 "f3dh",
173 "The height (y-axis) in a 3D flow",
174 reactive_graph_graph::DataType::Number,
175 reactive_graph_graph::SocketType::None,
176 reactive_graph_graph::Mutability::Mutable,
177 reactive_graph_graph::Extensions::new(),
178 )
179 }
180 Flow3DProperties::F_3_DW => {
181 reactive_graph_graph::PropertyType::new_with_all(
182 "f3dw",
183 "The width (x-axis) in a 3D flow",
184 reactive_graph_graph::DataType::Number,
185 reactive_graph_graph::SocketType::None,
186 reactive_graph_graph::Mutability::Mutable,
187 reactive_graph_graph::Extensions::new(),
188 )
189 }
190 Flow3DProperties::F_3_DX => {
191 reactive_graph_graph::PropertyType::new_with_all(
192 "f3dx",
193 "The X position in a 3D flow",
194 reactive_graph_graph::DataType::Number,
195 reactive_graph_graph::SocketType::None,
196 reactive_graph_graph::Mutability::Mutable,
197 reactive_graph_graph::Extensions::new(),
198 )
199 }
200 Flow3DProperties::F_3_DY => {
201 reactive_graph_graph::PropertyType::new_with_all(
202 "f3dy",
203 "The Y position in a 3D flow",
204 reactive_graph_graph::DataType::Number,
205 reactive_graph_graph::SocketType::None,
206 reactive_graph_graph::Mutability::Mutable,
207 reactive_graph_graph::Extensions::new(),
208 )
209 }
210 Flow3DProperties::F_3_DZ => {
211 reactive_graph_graph::PropertyType::new_with_all(
212 "f3dz",
213 "The Z position in a 3D flow",
214 reactive_graph_graph::DataType::Number,
215 reactive_graph_graph::SocketType::None,
216 reactive_graph_graph::Mutability::Mutable,
217 reactive_graph_graph::Extensions::new(),
218 )
219 }
220 }
221 }
222}
223
224pub struct Flow3DPropertiesIterator(Option<Flow3DProperties>);
225
226impl Flow3DProperties {
227 pub fn into_iter() -> Flow3DPropertiesIterator {
228 Flow3DPropertiesIterator(None)
229 }
230}
231
232impl Iterator for Flow3DPropertiesIterator {
233 type Item = Flow3DProperties;
234 fn next(&mut self) -> Option<Self::Item> {
235 self.0 = match self.0 {
236 None => Some(Flow3DProperties::F_3_DD),
237 Some(Flow3DProperties::F_3_DD) => Some(Flow3DProperties::F_3_DH),
238 Some(Flow3DProperties::F_3_DH) => Some(Flow3DProperties::F_3_DW),
239 Some(Flow3DProperties::F_3_DW) => Some(Flow3DProperties::F_3_DX),
240 Some(Flow3DProperties::F_3_DX) => Some(Flow3DProperties::F_3_DY),
241 Some(Flow3DProperties::F_3_DY) => Some(Flow3DProperties::F_3_DZ),
242 Some(Flow3DProperties::F_3_DZ) => None,
243 };
244 self.0.clone()
245 }
246}
247
248impl IntoIterator for Flow3DProperties {
249 type Item = Flow3DProperties;
250 type IntoIter = Flow3DPropertiesIterator;
251 fn into_iter(self) -> Self::IntoIter {
252 Flow3DPropertiesIterator(None)
253 }
254}
255
256impl core::fmt::Display for Flow3DProperties {
257 fn fmt(&self, f: &mut core::fmt::Formatter) -> Result<(), core::fmt::Error> {
258 match *self {
259 Flow3DProperties::F_3_DD => core::fmt::Display::fmt("f3dd", f),
260 Flow3DProperties::F_3_DH => core::fmt::Display::fmt("f3dh", f),
261 Flow3DProperties::F_3_DW => core::fmt::Display::fmt("f3dw", f),
262 Flow3DProperties::F_3_DX => core::fmt::Display::fmt("f3dx", f),
263 Flow3DProperties::F_3_DY => core::fmt::Display::fmt("f3dy", f),
264 Flow3DProperties::F_3_DZ => core::fmt::Display::fmt("f3dz", f),
265 }
266 }
267}
268
269pub static FLOW_3_D_EXTENSIONS: std::sync::LazyLock<reactive_graph_graph::Extensions> = std::sync::LazyLock::new(||
271{ reactive_graph_graph::Extensions::new() });
272
273pub static FLOW_3_D_TYPE: std::sync::LazyLock<reactive_graph_graph::Component> = std::sync::LazyLock::new(||
274{
275 reactive_graph_graph::Component::builder()
276 .ty(core::ops::Deref::deref(&FLOW_3_D))
277 .description(
278 "The position (x,y,z) of the entity or relation on a three dimensional flow (in-game visual scripting).",
279 )
280 .properties(Flow3DProperties::property_types())
281 .build()
282});
283
284pub trait Flow3D {
309
310 fn f3dd(&self) -> u64;
321
322 fn set_f3dd(&mut self, f3dd: u64);
333
334 fn f3dh(&self) -> u64;
345
346 fn set_f3dh(&mut self, f3dh: u64);
357
358 fn f3dw(&self) -> u64;
369
370 fn set_f3dw(&mut self, f3dw: u64);
381
382 fn f3dx(&self) -> u64;
393
394 fn set_f3dx(&mut self, f3dx: u64);
405
406 fn f3dy(&self) -> u64;
417
418 fn set_f3dy(&mut self, f3dy: u64);
429
430 fn f3dz(&self) -> u64;
441
442 fn set_f3dz(&mut self, f3dz: u64);
453}