From e1fe8abc1852549d68ad6ef3d87a40e1932a20d5 Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Mon, 16 Sep 2024 16:30:36 -0700 Subject: [PATCH] feat: use coponent like id --- .../parse-resolver-runtime.cc | 7 ++++--- test/stream_component.cc | 19 ++++++++++++++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/parse-resolver-runtime/parse-resolver-runtime.cc b/parse-resolver-runtime/parse-resolver-runtime.cc index 61c63bc..b6f49b9 100644 --- a/parse-resolver-runtime/parse-resolver-runtime.cc +++ b/parse-resolver-runtime/parse-resolver-runtime.cc @@ -1136,14 +1136,15 @@ auto ecsact_set_system_notify_component_setting( } auto ecsact_meta_component_type( // - ecsact_component_id component_id + ecsact_component_like_id comp_like_id ) -> ecsact_component_type { - auto comp_def = comp_defs.find(component_id); + auto comp_def = + comp_defs.find(static_cast(comp_like_id)); if(comp_def == comp_defs.end()) { // NOTE: this is temporary until we remove the transient fns and instead // embrace components with transient statement params auto trans_def = - trans_defs.find(static_cast(component_id)); + trans_defs.find(static_cast(comp_like_id)); if(trans_def != trans_defs.end()) { return ECSACT_COMPONENT_TYPE_TRANSIENT; } diff --git a/test/stream_component.cc b/test/stream_component.cc index ca82b03..3c4c65b 100644 --- a/test/stream_component.cc +++ b/test/stream_component.cc @@ -26,22 +26,31 @@ TEST_F(StreamComponent, SanityCheck) { auto comp_id = get_component_by_name(pkg_id, "MyNormieComponent"); ASSERT_TRUE(comp_id); - ASSERT_EQ(ecsact_meta_component_type(*comp_id), ECSACT_COMPONENT_TYPE_NONE); + auto comp_like_id = ecsact_meta_component_type( + ecsact_id_cast(*comp_id) + ); + + ASSERT_EQ(comp_like_id, ECSACT_COMPONENT_TYPE_NONE); } TEST_F(StreamComponent, HasStreamType) { auto comp_id = get_component_by_name(pkg_id, "MyStreamComponent"); ASSERT_TRUE(comp_id); - ASSERT_EQ(ecsact_meta_component_type(*comp_id), ECSACT_COMPONENT_TYPE_STREAM); + auto comp_type = ecsact_meta_component_type( + ecsact_id_cast(*comp_id) + ); + + ASSERT_EQ(comp_type, ECSACT_COMPONENT_TYPE_STREAM); } TEST_F(StreamComponent, HasLazyStreamType) { auto comp_id = get_component_by_name(pkg_id, "MyLazyStreamComponent"); ASSERT_TRUE(comp_id); - ASSERT_EQ( - ecsact_meta_component_type(*comp_id), - ECSACT_COMPONENT_TYPE_LAZY_STREAM + auto comp_type = ecsact_meta_component_type( + ecsact_id_cast(*comp_id) ); + + ASSERT_EQ(comp_type, ECSACT_COMPONENT_TYPE_LAZY_STREAM); }