AngularJS Service for tracking player game related information. It is possible to add to the values being tracked by default.
Members
(private, inner) defaultValues :Object
Stored default keys/values for tracking data.
- Source:
 
Type:
- 
            
Object 
(private, inner, nullable) currentValues :Object
Stored game tracking data.
- Source:
 
Type:
- 
            
Object 
Methods
(static) reset()
Resets stored tracking data to stored default values.
- Source:
 
(static) get() → {Object}
Get stored tracking data.
- Source:
 
Returns:
- Type:
 - 
        
Object 
(static) addKey(key, initVal)
Add tracking key with initial value to data object and defaults object.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
key | 
            
            
            
                
string
            
             | 
            
            
            |
initVal | 
            
            
            
                
*
            
             | 
            
            
            
(static) increment(key, val)
Increment a stored data key by a given value.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
key | 
            
            
            
                
string
            
             | 
            
            
            |
val | 
            
            
            
                
number
            
             | 
            
            
            
(static) update(key, val)
Set a stored data key to a given value (do not modify stored defaults)
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
key | 
            
            
            
                
string
            
             | 
            
            
            |
val | 
            
            
            
                
number
            
             | 
            
            
            
(private, inner) checkInit()
Used internally to ensure that stored tracking data is a useful object. Resets data to stored defaults if necessary.
- Source: