Differential D1294 Diff 6385 ps/trunk/binaries/data/mods/public/simulation/components/StatisticsTracker.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/StatisticsTracker.js
Show First 20 Lines • Show All 539 Lines • ▼ Show 20 Lines | if (cmpOtherPlayer && cmpOtherPlayer.GetTeam() == team) | ||||
teamPercent += cmpTerritoryManager.GetTerritoryPercentage(i); | teamPercent += cmpTerritoryManager.GetTerritoryPercentage(i); | ||||
} | } | ||||
return teamPercent; | return teamPercent; | ||||
}; | }; | ||||
StatisticsTracker.prototype.OnTerritoriesChanged = function(msg) | StatisticsTracker.prototype.OnTerritoriesChanged = function(msg) | ||||
{ | { | ||||
var newPercent = this.GetPercentMapControlled(); | this.UpdatePeakPercentages(); | ||||
if (newPercent > this.peakPercentMapControlled) | }; | ||||
this.peakPercentMapControlled = newPercent; | |||||
StatisticsTracker.prototype.OnGlobalPlayerDefeated = function(msg) | |||||
newPercent = this.GetTeamPercentMapControlled(); | { | ||||
if (newPercent > this.teamPeakPercentMapControlled) | this.UpdatePeakPercentages(); | ||||
this.teamPeakPercentMapControlled = newPercent; | }; | ||||
StatisticsTracker.prototype.OnGlobalPlayerWon = function(msg) | |||||
{ | |||||
this.UpdatePeakPercentages(); | |||||
}; | |||||
StatisticsTracker.prototype.UpdatePeakPercentages = function() | |||||
{ | |||||
this.peakPercentMapControlled = Math.max(this.peakPercentMapControlled, this.GetPercentMapControlled()); | |||||
this.teamPeakPercentMapControlled = Math.max(this.teamPeakPercentMapControlled, this.GetTeamPercentMapControlled()); | |||||
}; | }; | ||||
/** | /** | ||||
* Adds the values of fromData to the end of the arrays of toData. | * Adds the values of fromData to the end of the arrays of toData. | ||||
* If toData misses the needed array, one will be created. | * If toData misses the needed array, one will be created. | ||||
* | * | ||||
* @param fromData - an object of values or a value. | * @param fromData - an object of values or a value. | ||||
* @param toData - an object of arrays or an array. | * @param toData - an object of arrays or an array. | ||||
Show All 23 Lines |
Wildfire Games · Phabricator