From 9ac9b2cf6c1ef7a52c74e476674aef6052551a46 Mon Sep 17 00:00:00 2001 From: Madpwnhammer Date: Tue, 5 Dec 2023 17:11:48 +0300 Subject: [PATCH] Using native class where appropriate --- tpl/bind_ecslite.twig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tpl/bind_ecslite.twig b/tpl/bind_ecslite.twig index e2a0e3c..e90c146 100644 --- a/tpl/bind_ecslite.twig +++ b/tpl/bind_ecslite.twig @@ -11,7 +11,7 @@ if(e.Unpack(out EcsWorld world, out int id) == false) throw new Exception("No entity found"); - ref var cmp = ref world.GetPool<{{o.name}}>().Ensure(id); + ref var cmp = ref world.GetPool<{{token_or(o, 'bhl_native_class', o.name)}}>().Ensure(id); return null; } @@ -34,7 +34,7 @@ if(e.Unpack(out EcsWorld world, out int id) == false) return null; - world.GetPool<{{o.name}}>().Del(id); + world.GetPool<{{token_or(o, 'bhl_native_class', o.name)}}>().Del(id); return null; } @@ -59,7 +59,7 @@ if(e.Unpack(out EcsWorld world, out int id) == false) dv.SetBool(false); else - dv.SetBool(world.GetPool<{{o.name}}>().Has(id)); + dv.SetBool(world.GetPool<{{token_or(o, 'bhl_native_class', o.name)}}>().Has(id)); stack.Push(dv); return null; @@ -104,7 +104,7 @@ if(e.Unpack(out EcsWorld world, out int id) == false) throw new Exception("No entity found"); - ref var cmp = ref world.GetPool<{{o.name}}>().Ensure(id); + ref var cmp = ref world.GetPool<{{token_or(o, 'bhl_native_class', o.name)}}>().Ensure(id); var v = cmp.{{f.name}}; {%- if token_or(f, 'bhl_set', 1) != 0 ~%} @@ -148,7 +148,7 @@ if(e.Unpack(out EcsWorld world, out int id) == false) throw new Exception("No entity found"); - ref var cmp = ref world.GetPool<{{o.name}}>().Ensure(id); + ref var cmp = ref world.GetPool<{{token_or(o, 'bhl_native_class', o.name)}}>().Ensure(id); {%~ if m.returntype %} var return_val =