add shared test

This commit is contained in:
2025-03-06 08:31:22 +03:00
parent 42e9d6c45c
commit a3a6a3a07f
4 changed files with 25 additions and 4 deletions

View File

@@ -38,11 +38,11 @@ namespace VE
struct event_manager : public hack::patterns::singleton<event_manager>
{
std::vector<VE::event_fn<VE::event>> funcs;
void connect(event_fn<event> fn) { funcs.push_back(fn); };
std::vector<VE::event_fn<VE::event>> m_funcs;
void connect(event_fn<event> fn) { m_funcs.push_back(fn); };
void emit(event e)
{
for(auto& f : funcs)
for(auto& f : m_funcs)
{
try
{
@@ -51,10 +51,11 @@ namespace VE
catch(std::exception& e)
{
hack::error()(e.what());
hack::log()("size funcs", m_funcs.size());
}
catch(...)
{
hack::error()("ooops");
hack::error()("ooops...");
}
}
}