Archived
1

Pokedeks sorting almost as in game: grade-attack-name

This commit is contained in:
Vladimir Hodakov 2018-02-17 18:26:33 +04:00
parent ffb9863bf7
commit 3a5411f814

View File

@ -228,8 +228,8 @@ func (dc *DataCache) GetAllPokememes() map[int]*dbmapping.PokememeFull {
var keys []string var keys []string
keysToIDs := make(map[string]int) keysToIDs := make(map[string]int)
for i := range dc.fullPokememes { for i := range dc.fullPokememes {
keys = append(keys, strconv.Itoa(dc.fullPokememes[i].Pokememe.Grade)+"_"+dc.fullPokememes[i].Pokememe.Name) 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)+"_"+dc.fullPokememes[i].Pokememe.Name] = i 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) sort.Strings(keys)