2012-04-19 14:35:52 +08:00
|
|
|
#include "CCInvocation.h"
|
|
|
|
|
2012-04-27 18:47:49 +08:00
|
|
|
NS_CC_EXT_BEGIN
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2012-06-07 05:31:14 +08:00
|
|
|
CCInvocation::CCInvocation(CCObject* target, SEL_CCControlHandler action, CCControlEvent controlEvent)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
|
|
|
m_target=target;
|
|
|
|
m_action=action;
|
|
|
|
m_controlEvent=controlEvent;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CCInvocation::invoke(CCObject* sender)
|
|
|
|
{
|
|
|
|
if (m_target && m_action)
|
|
|
|
{
|
2012-06-07 05:31:14 +08:00
|
|
|
(m_target->*m_action)(sender, m_controlEvent);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-04-27 18:47:49 +08:00
|
|
|
NS_CC_EXT_END
|