mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 13:43:26 +00:00
New Set.iterateLocal method
This commit is contained in:
parent
3bbe07afb1
commit
390dcbf461
1 changed files with 22 additions and 0 deletions
|
@ -133,6 +133,28 @@ var Set = new Class({
|
|||
return this;
|
||||
},
|
||||
|
||||
iterateLocal: function (callbackKey)
|
||||
{
|
||||
var i;
|
||||
var args = [];
|
||||
|
||||
for (i = 1; i < arguments.length; i++)
|
||||
{
|
||||
args.push(arguments[i]);
|
||||
}
|
||||
|
||||
var len = this.entries.length;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
var entry = this.entries[i];
|
||||
|
||||
entry[callbackKey].apply(entry, args);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
clear: function ()
|
||||
{
|
||||
this.entries.length = 0;
|
||||
|
|
Loading…
Reference in a new issue