Skip to content

Commit

Permalink
Merge pull request #296 from Janzert/record-stats
Browse files Browse the repository at this point in the history
Record all player stats in replay file.
  • Loading branch information
harikmenon authored Nov 14, 2017
2 parents 9465b12 + a853682 commit 843f743
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions environment/core/Statistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ auto to_json(nlohmann::json& json, const GameStatistics& stats) -> void {
auto& player_stats = stats.player_statistics[player_id];
json[std::to_string(static_cast<int>(player_id))] = nlohmann::json{
{ "rank", player_stats.rank },
{ "last_frame_alive", player_stats.last_frame_alive },
{ "total_ship_count", player_stats.total_ship_count },
{ "damage_dealt", player_stats.damage_dealt },
{ "init_response_time", player_stats.init_response_time },
{ "average_frame_response_time", player_stats.average_frame_response_time },
};
}
}

0 comments on commit 843f743

Please sign in to comment.