Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add hasEventListener for CCEventDispatcher #425

Merged
merged 1 commit into from Dec 9, 2016
Merged

Conversation

knoxHuang
Copy link
Contributor

@knoxHuang knoxHuang commented Dec 6, 2016

https://github.com/cocos-creator/fireball/issues/4862

添加 hasEventListener 函数

@minggo @pandamicro @dumganhar 看看如果没问题谁合并一下 thx

*
* @return True if dispatching events is exist
*/
bool hasEventListener(std::string listenerID);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool hasEventListener(std::string listenerID) -> bool hasEventListener(const std::string& listenerID) const

@@ -857,6 +857,11 @@ void EventDispatcher::dispatchCustomEvent(const std::string &eventName, void *op
dispatchEvent(&ev);
}

bool EventDispatcher::hasEventListener(std::string listenerID)
{
return getListeners(listenerID) != nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getListeners接收的参数类型不是std::string啊

@knoxHuang
Copy link
Contributor Author

已经修复 @minggo

*
* @return True if dispatching events is exist
*/
bool hasEventListener(const EventListener::ListenerID& listenerID);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool hasEventListener(const EventListener::ListenerID& listenerID) -> bool hasEventListener(const EventListener::ListenerID& listenerID) const

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cpp里的实现函数也需要改

@nantas nantas merged commit b29c266 into cocos:v1.3 Dec 9, 2016
bofeng-song pushed a commit to bofeng-song/cocos2d-x-lite that referenced this pull request Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants