refactor: 添加辅助宏

This commit is contained in:
爱特每羊队
2026-06-07 15:46:38 +08:00
parent 453b7307c3
commit aa0de137f7
2 changed files with 173 additions and 126 deletions
+7
View File
@@ -5,6 +5,13 @@ use oxide_types::value::JsValue;
use crate::shape_forge::{ShapeForge, EMPTY_SHAPE_ID};
use crate::string_forge::StringForge;
#[macro_export]
macro_rules! bind_method {
($world:expr, $target:expr, $sf:expr, $sh:expr, $name:literal, $func:path, $nargs:literal) => {
let _ = $world.bind_method($target, $sh, $sf, $name, $func as *const (), $nargs);
};
}
pub struct ObjectMethods {
pub keys: *const (),
pub create: *const (),