File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -157,6 +157,7 @@ We've also removed functions and properties from Pixi classes that Phaser doesn'
157157* Tween.repeat has a new parameter ` repeatDelay ` which allows you to set the delay (in ms) before a tween will repeat itself.
158158* Tween.yoyo has a new parameter ` yoyoDelay ` which allows you to set the delay (in ms) before a tween will start a yoyo.
159159* Tween.interpolation has a new parameter ` context ` which allows you to define the context in which the interpolation function will run.
160+ * ArraySet.getByKey gets an item from the set based on the property strictly equaling the value given.
160161
161162### Bug Fixes
162163
Original file line number Diff line number Diff line change @@ -67,6 +67,31 @@ Phaser.ArraySet.prototype = {
6767
6868 } ,
6969
70+ /**
71+ * Gets an item from the set based on the property strictly equaling the value given.
72+ * Returns null if not found.
73+ *
74+ * @method Phaser.ArraySet#getByKey
75+ * @param {string } property - The property to check against the value.
76+ * @param {any } value - The value to check if the property strictly equals.
77+ * @return {any } The item that was found, or null if nothing matched.
78+ */
79+ getByKey : function ( property , value ) {
80+
81+ var i = this . list . length ;
82+
83+ while ( i -- )
84+ {
85+ if ( this . list [ i ] [ property ] === value )
86+ {
87+ return this . list [ i ] ;
88+ }
89+ }
90+
91+ return null ;
92+
93+ } ,
94+
7095 /**
7196 * Checks for the item within this list.
7297 *
You can’t perform that action at this time.
0 commit comments