Skip to content
This repository was archived by the owner on Jul 30, 2022. It is now read-only.

Commit 1920abf

Browse files
committed
rename Notification to Event
1 parent cd57f8c commit 1920abf

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

sdk

Submodule sdk updated from c6ba3e3 to 9f4d4d5

src/Notification.cpp renamed to src/Event.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
#include <loader/Notification.hpp>
1+
#include <loader/Event.hpp>
22
#include <Geode.hpp>
33

44
USE_GEODE_NAMESPACE();
55

6-
NotificationCenter* NotificationCenter::shared = nullptr;
6+
EventCenter* EventCenter::shared = nullptr;
77

8-
NotificationCenter::NotificationCenter() : m_observers() {
8+
EventCenter::EventCenter() : m_observers() {
99
// cocos2d::CCDirector::sharedDirector()->getScheduler()->scheduleUpdateForTarget((cocos2d::CCObject*)this, 0, false);
1010
}
1111

12-
NotificationCenter* NotificationCenter::get() {
13-
if (NotificationCenter::shared == nullptr)
14-
NotificationCenter::shared = new NotificationCenter;
15-
return NotificationCenter::shared;
12+
EventCenter* EventCenter::get() {
13+
if (EventCenter::shared == nullptr)
14+
EventCenter::shared = new EventCenter;
15+
return EventCenter::shared;
1616
}
1717

18-
/*void NotificationCenter::send(Notification n, Mod* m) {
18+
/*void EventCenter::send(Event n, Mod* m) {
1919
for (auto& obs : m_observers[m][n.selector()]) {
2020
obs->m_callback(n);
2121
}
2222
}
2323
24-
void NotificationCenter::broadcast(Notification n) {
24+
void EventCenter::broadcast(Event n) {
2525
for (auto& [k, v] : m_observers) {
2626
for (auto& obs : v[n.selector()]) {
2727
obs->m_callback(n);
2828
}
2929
}
3030
}
3131
32-
Observer* NotificationCenter::registerObserver(Mod* m, std::string selector, callback_t cb) {
32+
Observer* EventCenter::registerObserver(Mod* m, std::string selector, callback_t cb) {
3333
Observer* ob = new Observer;
3434
ob->m_selector = selector;
3535
ob->m_callback = cb;
@@ -40,7 +40,7 @@ Observer* NotificationCenter::registerObserver(Mod* m, std::string selector, cal
4040
return ob;
4141
}*/
4242

43-
void NotificationCenter::unregisterObserver(Observer<std::monostate>* ob) {
43+
void EventCenter::unregisterObserver(Observer<std::monostate>* ob) {
4444
auto& v2 = m_observers[ob->m_mod][ob->m_info.selector];
4545
v2.erase(std::remove(v2.begin(), v2.end(), ob), v2.end());
4646

@@ -49,7 +49,7 @@ void NotificationCenter::unregisterObserver(Observer<std::monostate>* ob) {
4949
delete ob;
5050
}
5151

52-
std::vector<Observer<std::monostate>*> NotificationCenter::getObservers(std::string selector, Mod* m) {
52+
std::vector<Observer<std::monostate>*> EventCenter::getObservers(std::string selector, Mod* m) {
5353
if (m) {
5454
return m_observers[m][selector];
5555
} else {

0 commit comments

Comments
 (0)