| Total Complexity | 5 |
| Complexity/F | 1.25 |
| Lines of Code | 28 |
| Function Count | 4 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | 'use strict'; |
||
| 2 | |||
| 3 | angular |
||
| 4 | .module('game') |
||
| 5 | .service('state', [function() { |
||
| 6 | this.currentElement = 'H'; |
||
| 7 | this.hoverElement = ''; |
||
| 8 | this.export = ''; |
||
| 9 | this.player = {}; |
||
| 10 | this.loading = true; |
||
| 11 | let updateFunctions = []; |
||
| 12 | |||
| 13 | this.init = function() { |
||
| 14 | this.currentElement = 'H'; |
||
| 15 | this.hoverElement = ''; |
||
| 16 | this.export = ''; |
||
| 17 | }; |
||
| 18 | |||
| 19 | this.registerUpdate = function(func){ |
||
| 20 | updateFunctions.push(func); |
||
| 21 | }; |
||
| 22 | |||
| 23 | this.update = function(player){ |
||
| 24 | for(let func of updateFunctions){ |
||
| 25 | func(player); |
||
| 26 | } |
||
| 27 | }; |
||
| 28 | }]); |
||
| 29 |