add shared test
This commit is contained in:
@@ -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...");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user