diff --git a/assets/tests/lua/entity_variable.lua b/assets/tests/lua/entity_variable.lua index e69de29..4bf3745 100644 --- a/assets/tests/lua/entity_variable.lua +++ b/assets/tests/lua/entity_variable.lua @@ -0,0 +1,3 @@ +function test_func() + rust_func(entity.index) +end diff --git a/assets/tests/lua/entity_variable_eval.lua b/assets/tests/lua/entity_variable_eval.lua index e69de29..fdc8f94 100644 --- a/assets/tests/lua/entity_variable_eval.lua +++ b/assets/tests/lua/entity_variable_eval.lua @@ -0,0 +1,5 @@ +index = entity.index + +function test_func() + rust_func(index) +end diff --git a/assets/tests/lua/pass_entity_from_script.lua b/assets/tests/lua/pass_entity_from_script.lua new file mode 100644 index 0000000..355ef3a --- /dev/null +++ b/assets/tests/lua/pass_entity_from_script.lua @@ -0,0 +1,3 @@ +function test_func() + rust_func(entity) +end diff --git a/assets/tests/lua/pass_vec3_from_script.lua b/assets/tests/lua/pass_vec3_from_script.lua new file mode 100644 index 0000000..bd2a772 --- /dev/null +++ b/assets/tests/lua/pass_vec3_from_script.lua @@ -0,0 +1,3 @@ +function test_func() + rust_func(Vec3(1.5, 2.5, -3.5)) +end diff --git a/assets/tests/lua/pass_vec3_to_script.lua b/assets/tests/lua/pass_vec3_to_script.lua new file mode 100644 index 0000000..4a9d395 --- /dev/null +++ b/assets/tests/lua/pass_vec3_to_script.lua @@ -0,0 +1,7 @@ +function test_func(vec3) + -- raise unless vec3.is_a?(Vec3) # TODO: BevyScriptum::Vec3 and add example how to include it globally like Sinatra does + -- raise unless vec3.x == 1.5 + -- raise unless vec3.y == 2.5 + -- raise unless vec3.z == -3.5 + mark_success() +end diff --git a/src/runtimes/ruby.rs b/src/runtimes/ruby.rs index db1f908..74b4b3d 100644 --- a/src/runtimes/ruby.rs +++ b/src/runtimes/ruby.rs @@ -4,6 +4,7 @@ // TODO: maybe unify api and call non thread methods non_send // TODO: add tests for entity variable and buitin types for every runtime // TODO: line numbers for errors +// TODO: caan rhai have Vec3 constructor instead of vec3_new use std::{ collections::HashMap,