Remove dependency of cc._Class from EventManager

d
This commit is contained in:
pandamicro
2018-02-12 18:08:42 +08:00
parent 304f89715b
commit b68d48730d
2 changed files with 15 additions and 17 deletions
+8 -9
View File
@@ -26,14 +26,13 @@ var js = require('../platform/js');
require('./CCEventListener');
var ListenerID = cc.EventListener.ListenerID;
var _EventListenerVector = cc._Class.extend({
ctor: function () {
this._fixedListeners = [];
this._sceneGraphListeners = [];
this.gt0Index = 0;
},
var _EventListenerVector = function () {
this._fixedListeners = [];
this._sceneGraphListeners = [];
this.gt0Index = 0;
};
_EventListenerVector.prototype = {
constructor: _EventListenerVector,
size: function () {
return this._fixedListeners.length + this._sceneGraphListeners.length;
},
@@ -69,7 +68,7 @@ var _EventListenerVector = cc._Class.extend({
getSceneGraphPriorityListeners: function () {
return this._sceneGraphListeners;
}
});
};
var __getListenerID = function (event) {
var eventType = cc.Event, type = event.type;
+7 -8
View File
@@ -32,13 +32,12 @@
* @param {Number} y
* @param {Number} id
*/
cc.Touch = cc._Class.extend(/** @lends cc.Touch# */{
ctor:function (x, y, id) {
this._lastModified = 0;
this.setTouchInfo(id, x, y);
},
cc.Touch = function (x, y, id) {
this._lastModified = 0;
this.setTouchInfo(id, x, y);
};
cc.Touch.prototype = {
constructor: cc.Touch,
/**
* !#en Returns the current touch location in OpenGL coordinates.、
* !#zh 获取当前触点位置。
@@ -180,4 +179,4 @@ cc.Touch = cc._Class.extend(/** @lends cc.Touch# */{
else
this._prevPoint = cc.p(x || 0, y || 0);
}
});
};