Added some lines in comments for clarity

This commit is contained in:
Xiao Qi 2022-09-15 18:37:05 +08:00
parent e1074887c8
commit f9743f394d
2 changed files with 2 additions and 1 deletions

View File

@ -6,5 +6,4 @@ typedef uint32_t SHEventHandle;
typedef void* SHEventDataPtr; typedef void* SHEventDataPtr;
//Add your event identifiers here: //Add your event identifiers here:
constexpr SHEventIdentifier SH_EXAMPLE_EVENT{0}; constexpr SHEventIdentifier SH_EXAMPLE_EVENT{0};

View File

@ -38,6 +38,8 @@
ReceiverPtr receiver = std::dynamic_pointer_cast<SHEventReceiver>(thisReceiver); ReceiverPtr receiver = std::dynamic_pointer_cast<SHEventReceiver>(thisReceiver);
SHEventManager::SubscribeTo(EVENT_IDENTIFIER, receiver); SHEventManager::SubscribeTo(EVENT_IDENTIFIER, receiver);
ReceiverClass is the class that the receiver is in. E.g., SHPhysicsSystem
3. Note: The EventIdentifier should match all that is defined in 3. Note: The EventIdentifier should match all that is defined in
SHEventDefines.h so check there. When the receiver catches the event, it SHEventDefines.h so check there. When the receiver catches the event, it
needs to know the struct that the broadcaster is using to cast the void* needs to know the struct that the broadcaster is using to cast the void*