Differential D2385 Diff 10187 binaries/data/mods/public/gui/session/lobby/LobbyRatingReport/Resources.js
Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/lobby/LobbyRatingReport/Resources.js
- This file was added.
Property | Old Value | New Value |
---|---|---|
svn:eol-style | null | native \ No newline at end of property |
/** | |||||
* This class reports the amount of resources that each player has obtained or used. | |||||
*/ | |||||
LobbyRatingReport.prototype.Resources = class | |||||
{ | |||||
InsertValues(report, extenededSimState, playerStates) | |||||
{ | |||||
let time = playerStates[0].sequences.time.length - 1; | |||||
for (let action of this.Actions) | |||||
for (let resCode of g_ResourceData.GetCodes()) | |||||
report[resCode + action] = playerStates.map(playerState => | |||||
playerState.sequences["resources" + action][resCode][time]).join(",") + ","; | |||||
report.vegetarianFoodGathered = playerStates.map( | |||||
playerState => playerState.sequences.resourcesGathered.vegetarianFood[time]).join(",") + ","; | |||||
} | |||||
}; | |||||
LobbyRatingReport.prototype.Resources.prototype.Actions = [ | |||||
"Gathered", | |||||
"Used", | |||||
"Sold", | |||||
"Bought" | |||||
]; |
Wildfire Games · Phabricator