(items, key, value, step, index, direction)
| 27 | * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. |
| 28 | */ |
| 29 | var PropertyValueSet = function (items, key, value, step, index, direction) |
| 30 | { |
| 31 | if (step === undefined) { step = 0; } |
| 32 | if (index === undefined) { index = 0; } |
| 33 | if (direction === undefined) { direction = 1; } |
| 34 | |
| 35 | var i; |
| 36 | var t = 0; |
| 37 | var end = items.length; |
| 38 | |
| 39 | if (direction === 1) |
| 40 | { |
| 41 | // Start to End |
| 42 | for (i = index; i < end; i++) |
| 43 | { |
| 44 | items[i][key] = value + (t * step); |
| 45 | t++; |
| 46 | } |
| 47 | } |
| 48 | else |
| 49 | { |
| 50 | // End to Start |
| 51 | for (i = index; i >= 0; i--) |
| 52 | { |
| 53 | items[i][key] = value + (t * step); |
| 54 | t++; |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | return items; |
| 59 | }; |
| 60 | |
| 61 | module.exports = PropertyValueSet; |
no outgoing calls
no test coverage detected
searching dependent graphs…