Class: Stats

HungryGames~ Stats


new Stats(data)

HG stats for a single user in a single timeframe.
Parameters:
Name Type Description
data HungryGames~Stats | string Data to initialize this stats object with, or ID of user this instance represents.
Source:

Members


<static> keys

Get array of all keys stored by this object when requested from a static scope.
Source:

<private> _data :object

Cache of all datapoints. All properties must match SQL database excluding `groupId`, `guildId` and `userId` which must not be included.
Type:
  • object
Properties:
Name Type Description
kills number Number of kills.
deaths number Number of deaths.
wounds number Number of times wounded.
heals number Number of times wounds have healed.
revives number Number of times revived.
wins number Number of games won.
losses number Number of games lost.
daysAlive number Number of days spent alive (includes wounded).
daysDead number Number of days spent dead.
daysWounded number Number of days spent wounded.
Source:

<constant> _id :string

The ID of the user this object represents.
Type:
  • string
Source:

id

The ID this of the user this object represents.
Source:

keys

Get array of all keys stored by this object.
Source:

serializable

Fetch the data stored here as a serializable object.
Source:

Methods


<static> from(obj)

Create a Stats object instance from a Stats-like object.
Parameters:
Name Type Description
obj object The object to create a Stats instance of.
Source:
Returns:
The created instance.
Type
HungryGames~Stats

get(key)

Fetch the value of a certain data point.
Parameters:
Name Type Description
key string The name of the datapoint.
Source:
Returns:
The value, or undefined if unable to be found.
Type
number

set(key, value)

Set a value for a certain datapoint.
Parameters:
Name Type Description
key string The name of this datapoint.
value number The new value to set.
Source: