feat: first working version with parameters

This commit is contained in:
2024-04-15 18:46:34 +02:00
parent e29cb11b81
commit 0254bc1ae5
45 changed files with 389 additions and 351 deletions

View File

@@ -0,0 +1,18 @@
use crate::encoding;
pub fn math_node(args: &[i32]) -> (i32, i32) {
let math_type = args[0];
let a = encoding::decode_float(args[1], args[2]);
let b = encoding::decode_float(args[3], args[4]);
let result = match math_type {
0 => a + b,
1 => a - b,
2 => a * b,
3 => a / b,
_ => 0.0,
};
encoding::encode_float(result)
}