Skip to main content

GameStats

The Game Stats is the data type that contains statistics about a game. It is included in the GameSave data type.

Data Type

The data type for GameStats is defined here, and is reproduced below for convenience:

import { Faction } from '../constants/factions'

export type GameStats = {
/** the number of days the game lasted */
numDays: number
/** the number of players in each faction */
numPlayers: { [faction in Faction]: number }
/** the number of players in each faction who are still alive */
numAlive: { [faction in Faction]: number }
/** the number of players in each faction who are dead */
numDead: { [faction in Faction]: number }
/** the number of players in each faction who were killed during the day */
numDayDeaths: { [faction in Faction]: number }
/** the number of players in each faction who were killed during the night */
numNightDeaths: { [faction in Faction]: number }
}

Sample Data

{
"numAlive": {
"discord": 2,
"harmony": 0,
"neutral": 0
},
"numDayDeaths": {
"discord": 0,
"harmony": 2,
"neutral": 0
},
"numDays": 3,
"numDead": {
"discord": 0,
"harmony": 4,
"neutral": 0
},
"numNightDeaths": {
"discord": 0,
"harmony": 2,
"neutral": 0
},
"numPlayers": {
"discord": 2,
"harmony": 4,
"neutral": 0
}
}