New rank and score calculation

This commit is contained in:
nemunaire 2017-01-12 11:52:51 +01:00
commit 37310e41f5
3 changed files with 14 additions and 16 deletions

View file

@ -8,7 +8,7 @@ type exportedTeam struct {
Name string `json:"name"`
Color string `json:"color"`
Rank int `json:"rank"`
Points int64 `json:"score"`
Points float64 `json:"score"`
}
func ExportTeams() (interface{}, error) {
@ -19,15 +19,12 @@ func ExportTeams() (interface{}, error) {
} else {
ret := map[string]exportedTeam{}
for _, team := range teams {
if points, err := team.GetPoints(); err != nil {
return nil, err
} else {
ret[fmt.Sprintf("%d", team.Id)] = exportedTeam{
team.Name,
fmt.Sprintf("#%x", team.Color),
rank[team.Id],
points,
}
points, _ := team.GetPoints()
ret[fmt.Sprintf("%d", team.Id)] = exportedTeam{
team.Name,
fmt.Sprintf("#%x", team.Color),
rank[team.Id],
points,
}
}