mirror of https://github.com/axmolengine/axmol.git
Merge pull request #3695 from dumganhar/iss2087-new-event-dispatcher
Make XXXEventListener as friend class of XXXEvent. Move the test of eventdispatchertest.
This commit is contained in:
commit
f23ca6a52c
|
@ -39,6 +39,7 @@ public:
|
|||
|
||||
private:
|
||||
Acceleration _acc;
|
||||
friend class AccelerationEventListener;
|
||||
};
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -56,7 +56,7 @@ bool AccelerationEventListener::init(std::function<void(Acceleration*, Event* ev
|
|||
{
|
||||
auto listener = [this](Event* event){
|
||||
auto accEvent = static_cast<AccelerationEvent*>(event);
|
||||
this->onAccelerationEvent(&accEvent->acc, event);
|
||||
this->onAccelerationEvent(&accEvent->_acc, event);
|
||||
};
|
||||
|
||||
if (EventListener::init(AccelerationEvent::EVENT_TYPE, listener))
|
||||
|
|
|
@ -207,6 +207,8 @@ public:
|
|||
private:
|
||||
KeyCode _keyCode;
|
||||
bool _isPressed;
|
||||
|
||||
friend class KeyboardEventListener;
|
||||
};
|
||||
|
||||
NS_CC_END
|
||||
|
|
|
@ -14,8 +14,6 @@ struct {
|
|||
const char *test_name;
|
||||
std::function<TestScene*()> callback;
|
||||
} g_aTestNames[] = {
|
||||
|
||||
{ "NewEventDispatcherTest", []() { return new EventDispatcherTestScene(); } },
|
||||
{ "Accelerometer", []() { return new AccelerometerTestScene(); } },
|
||||
{ "ActionManagerTest", [](){return new ActionManagerTestScene(); } },
|
||||
{ "ActionsEaseTest", [](){return new ActionsEaseTestScene();} },
|
||||
|
@ -44,6 +42,7 @@ struct {
|
|||
#endif
|
||||
{ "CurrentLanguageTest", []() { return new CurrentLanguageTestScene(); } },
|
||||
{ "DrawPrimitivesTest", [](){return new DrawPrimitivesTestScene();} },
|
||||
{ "EventDispatcherTest", []() { return new EventDispatcherTestScene(); } },
|
||||
{ "EffectAdvancedTest", []() { return new EffectAdvanceScene(); } },
|
||||
{ "EffectsTest", [](){return new EffectTestScene();} },
|
||||
{ "ExtensionsTest", []() { return new ExtensionsTestScene(); } },
|
||||
|
|
Loading…
Reference in New Issue