Class TeamScoreTable
Assumes a set pool of points that can be distributed amongst any known number of teams, and a neutral team.
public class TeamScoreTable
- Inheritance
-
TeamScoreTable
- Inherited Members
Constructors
TeamScoreTable(IReadOnlyList<Team>, double)
public TeamScoreTable(IReadOnlyList<Team> teams, double neutralScore)
Parameters
teamsIReadOnlyList<Team>neutralScoredouble
Properties
this[Team?]
Get the score for a team, or the neutral score if team is null.
public double this[Team? team] { get; }
Parameters
teamTeam
Property Value
MaxScore
public double MaxScore { get; }
Property Value
Teams
public IReadOnlyList<Team> Teams { get; set; }
Property Value
Methods
DecrementPoints(Team?, double, bool)
Decrease the amount of points for a team by amount.
public double DecrementPoints(Team? team, double amount, bool toNeutral)
Parameters
Returns
Exceptions
- ArgumentOutOfRangeException
Unknown team.
Distribute(params double[])
Distributes the total score given a set ration (where the first index is the neutral team).
public void Distribute(params double[] ratio)
Parameters
ratiodouble[]
DistributeUniformly()
Distributes the total score over all teams (except the netural team).
public void DistributeUniformly()
IncrementPoints(Team?, double)
Increase the amount of points for a team by amount.
public double IncrementPoints(Team? team, double amount)
Parameters
Returns
Exceptions
- ArgumentOutOfRangeException
Unknown team.
MaximizeTeam(Team?)
Distributes the entire score to the neutral team.
public void MaximizeTeam(Team? team)
Parameters
teamTeam
MinimizeTeam(Team?)
Distributes the entire score to the neutral team.
public void MinimizeTeam(Team? team)
Parameters
teamTeam
NeutralizeScores()
Distributes the entire score to the neutral team.
public void NeutralizeScores()
ToGraph(bool)
Creates a graph for visualizing the different scores.
public string ToGraph(bool scaleToMaximum = false)
Parameters
scaleToMaximumbool
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.