Skip to content

Commit

Permalink
Fix mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
DisabledMallis committed Jun 6, 2024
1 parent f7e1f67 commit c246a10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions include/nes/event_dispatcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ namespace nes {
template<typename priority_t> struct event_priority_traits { using priority_type = priority_t; };

#ifndef NES_PRIORITY_TYPE
using event_priority = standard_event_priority;
template<> struct event_priority_traits<event_priority> { using priority_type = priority_t; static constexpr priority_type default_value = priority_type::NORMAL; };
using event_priority = detail::standard_event_priority;
template<> struct event_priority_traits<event_priority> { using priority_type = event_priority; static constexpr priority_type default_value = priority_type::NORMAL; };
#else
using event_priority = NES_PRIORITY_TYPE;
#ifndef NES_PRIORITY_TRAITS
Expand Down
8 changes: 4 additions & 4 deletions test/test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

/*
enum struct MyCustomPriorities {
Immediate,
High,
Expand All @@ -7,7 +7,7 @@ enum struct MyCustomPriorities {
Last
};
#define NES_PRIORITY_TYPE MyCustomPriorities
#define NES_PRIORITY_TRAITS template<> struct nes::event_priority_traits<NES_PRIORITY_TYPE> { using priority_type = NES_PRIORITY_TYPE; static constexpr priority_type default_value = priority_type::Regular; };
#define NES_PRIORITY_TRAITS template<> struct nes::event_priority_traits<NES_PRIORITY_TYPE> { using priority_type = NES_PRIORITY_TYPE; static constexpr priority_type default_value = priority_type::Regular; };*/
#include <nes/event_dispatcher.hpp>

#include <iostream>
Expand All @@ -18,9 +18,9 @@ struct MyEvent {

struct SomeClass {
explicit SomeClass(nes::event_dispatcher& dispatcher) : mDispatcher{dispatcher} {
dispatcher.listen<MyEvent, &SomeClass::onMyFirstEvent, nes::event_priority::Immediate>(this);
dispatcher.listen<MyEvent, &SomeClass::onMyFirstEvent, nes::event_priority::FIRST>(this);
dispatcher.listen<MyEvent, &SomeClass::onMyNormalEvent>(this);
dispatcher.listen<MyEvent, &SomeClass::onMyLastEvent, nes::event_priority::Last>(this);
dispatcher.listen<MyEvent, &SomeClass::onMyLastEvent, nes::event_priority::LAST>(this);
}
~SomeClass() {
mDispatcher.deafen<MyEvent, &SomeClass::onMyFirstEvent>(this);
Expand Down

0 comments on commit c246a10

Please sign in to comment.