From 3a5411f814a53d624b289f1b294dce5ea1e18f7d Mon Sep 17 00:00:00 2001 From: Vladimir Hodakov Date: Sat, 17 Feb 2018 18:26:33 +0400 Subject: [PATCH] Pokedeks sorting almost as in game: grade-attack-name --- lib/datacache/pokememes.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/datacache/pokememes.go b/lib/datacache/pokememes.go index d0c1119..42b51dc 100644 --- a/lib/datacache/pokememes.go +++ b/lib/datacache/pokememes.go @@ -228,8 +228,8 @@ func (dc *DataCache) GetAllPokememes() map[int]*dbmapping.PokememeFull { var keys []string keysToIDs := make(map[string]int) for i := range dc.fullPokememes { - keys = append(keys, strconv.Itoa(dc.fullPokememes[i].Pokememe.Grade)+"_"+dc.fullPokememes[i].Pokememe.Name) - keysToIDs[strconv.Itoa(dc.fullPokememes[i].Pokememe.Grade)+"_"+dc.fullPokememes[i].Pokememe.Name] = i + keys = append(keys, strconv.Itoa(dc.fullPokememes[i].Pokememe.Grade)+"_"+strconv.Itoa(dc.fullPokememes[i].Pokememe.Attack+100000000000000)+"_"+dc.fullPokememes[i].Pokememe.Name) + keysToIDs[strconv.Itoa(dc.fullPokememes[i].Pokememe.Grade)+"_"+strconv.Itoa(dc.fullPokememes[i].Pokememe.Attack+100000000000000)+"_"+dc.fullPokememes[i].Pokememe.Name] = i } sort.Strings(keys)