cocos2d/cocos2d-x — pull request #4008 by dumganhar (2013-10-25 08:09:38+00:00)
Title: issue #3069: Refactor and Improve EventDispatcher

Changes contains:

* `EventListenerTouch` has to be separated to `EventListenerTouchOneByOne` and `EventListenerTouchAllAtOnce`, it will be clearer for developer to decide to use which type of touch event listener.

* Remove all controller codes from `cocos2d::Layer`. `Layer` should not be a controller. All event listener registrations should use `EventDispatcher`.

* Don’t insert member variables which are not relevant to `Node`. `Node` should be as **small**, **fast** as possible.

* Improve the **SORT** logic of `EventListener`, we should divide event listeners into two parts and store them in different vectors. One is for `fixed priority event listeners`, another is for `scene graph based priority listeners`. In this way, when a listener’s priority is changed, only one of the vectors should be sorted.