C# Class BF2Statistics.Web.Bf2Stats.RankCalculator

The RankCalulator object is used to programmatically determine the next ranks that can be earned by a player given its current stats and awards
Show file Open project: BF2Statistics/ControlCenter Class Usage Examples

Public Methods

Method Description
GetNextRanks ( int Score, int Rank, int>.Dictionary Awards, int Count = 3 ) : List

Generates the next Count ranks that can currently be obtained by the player

SetRankData ( Rank RankData ) : void

Used when the RankData.xml is loaded by the StatsData object, to set the rank requirements

Private Methods

Method Description
GenerateMissingDesc ( Rank Rnk, bool ForPrevRank ) : string

Generates the Missing Awards description message, based on what awards are missing

GetNextRankUps ( int CurRank, int>.Dictionary Awards ) : List

Returns a rank array of ranks that can be "jumped" to from the current rank Example: Gunnery Seargent -> Return would be Master Sergeant, and First Sergeant

Method Details

GetNextRanks() public static method

Generates the next Count ranks that can currently be obtained by the player
public static GetNextRanks ( int Score, int Rank, int>.Dictionary Awards, int Count = 3 ) : List
Score int The players current score
Rank int The players current rank ID
Awards int>.Dictionary All the players earned awards
Count int The number of next ranks to display
return List

SetRankData() public static method

Used when the RankData.xml is loaded by the StatsData object, to set the rank requirements
public static SetRankData ( Rank RankData ) : void
RankData Rank
return void