简化 getItemsByType 方法
This commit is contained in:
parent
e7d5cfac29
commit
4677645b2f
4
game.js
4
game.js
@ -266,9 +266,7 @@ function Game(id,params){
|
|||||||
//获取对象列表
|
//获取对象列表
|
||||||
Stage.prototype.getItemsByType = function(type){
|
Stage.prototype.getItemsByType = function(type){
|
||||||
return this.items.filter(function(item){
|
return this.items.filter(function(item){
|
||||||
if(item.type==type){
|
return item.type == type;
|
||||||
return item;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
//添加地图
|
//添加地图
|
||||||
|
Loading…
x
Reference in New Issue
Block a user