About CCEvent

hi,guys!
i was using cocos2dx to build my game,but i found it’s hard to catch muti-Touches in CCTargetedTouchDelegate while i want to swallow touches over other Layers,
i get the implement of CCEvent and it was

class CC_DLL CCEvent : public CCObject
{
};

so i can’t get the infomation about touchEvent
so i also can’t get the number of touches.

what’s more i also find CCTouchDelegate in 2dx,

class CC_DLL CCTouchDelegate
{
public:

CCTouchDelegate() {}

virtual ~CCTouchDelegate()
{
}

virtual bool ccTouchBegan(CCTouch pTouch, CCEventpEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent); return false;};
// optional

virtual void ccTouchMoved(CCTouch pTouch, CCEventpEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchEnded(CCTouch pTouch, CCEventpEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchCancelled(CCTouch pTouch, CCEventpEvent) {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);}

// optional
virtual void ccTouchesBegan(CCSet pTouches, CCEventpEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchesMoved(CCSet pTouches, CCEventpEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchesEnded(CCSet pTouches, CCEventpEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}
virtual void ccTouchesCancelled(CCSet pTouches, CCEventpEvent) {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}

};

but it also dosn’t work well,
it’s any sugestions ?

i can not find a good way,so i changed the source code of 2dx like this:

class CC_DLL CCEvent : public CCObject
{
private:
CCSet * m_allTouches;
public:
CCSet * allTouches(){return m_allTouches;}
void setTouches(CCSet * touchSet){
m_allTouches=touchSet;
}
};

and in CCTouchDispatcher add some lines in these methods

void CCTouchDispatcher::touchesBegan(CCSet touches, CCEventpEvent)
{
if (m_bDispatchEvents)
{
pEvent=new CCEvent();
pEvent~~>autorelease;
pEvent~~>setTouches(touches);
this~~>touches;
}
}
void CCTouchDispatcher::touchesMoved
{
if
{
pEvent=new CCEvent;
pEvent~~>autorelease();
pEvent~~>setTouches;
this~~>touches(touches, pEvent, CCTOUCHMOVED);
}
}

void CCTouchDispatcher::touchesEnded(CCSet touches, CCEventpEvent)
{
if (m_bDispatchEvents)
{
pEvent=new CCEvent();
pEvent~~>autorelease;
pEvent~~>setTouches(touches);
this~~>touches;
}
}
void CCTouchDispatcher::touchesCancelled
{
if
{
pEvent=new CCEvent;
pEvent~~>autorelease();
pEvent~~>setTouches;
this~~>touches(touches, pEvent, CCTOUCHCANCELLED);
}
}

so i can get Multi-Touches in CCTargetedDelegate like this

pEvent->allTouches()