Conversation
|
An example of use would be to call Fetch at init and if fail, use Load with the previously cached file? |
|
If we plan to ship Golbat with some version of MasterFile in repo, we could fire If we don't provide any MF within a repo, we can still potentially get a fail on fresh Golbat copy - on Thank you, @jfberry - fixed! Good eye! |
If you supply one with golbat, then startup should probably be: |
|
Ultimately golbat should just decode the masterfile proto message and feed that to gohbem but that's for another day |
|
Sounds good to me. Let me know if everything we want is provided within a PR - I will merge and add a version tag. |
If we can provide this data, I can add a method to update internal struct. Here's everything from MF we need to handle calculations: type PokemonData struct {
// Initialized bool `json:"-"`
Pokemon map[int]Pokemon `json:"pokemon"`
Costumes map[int]bool `json:"costumes"`
}
type Pokemon struct {
Attack int `json:"attack"`
Defense int `json:"defense"`
Stamina int `json:"stamina"`
Little bool `json:"little,omitempty"`
Evolutions []Evolution `json:"evolutions,omitempty"`
TempEvolutions map[int]PokemonStats `json:"temp_evolutions,omitempty"`
CostumeOverrideEvolutions []int `json:"costume_override_evos,omitempty"`
Forms map[int]Form `json:"forms"`
}
type Form struct {
Attack int `json:"attack,omitempty"`
Defense int `json:"defense,omitempty"`
Stamina int `json:"stamina,omitempty"`
Little bool `json:"little,omitempty"`
Evolutions []Evolution `json:"evolutions,omitempty"`
TempEvolutions map[int]PokemonStats `json:"temp_evolutions,omitempty"`
CostumeOverrideEvolutions []int `json:"costume_override_evos,omitempty"`
}
type PokemonStats struct {
Attack int `json:"attack,omitempty"`
Defense int `json:"defense,omitempty"`
Stamina int `json:"stamina,omitempty"`
Unreleased bool `json:"unreleased,omitempty"`
}
type Evolution struct {
Pokemon int `json:"pokemon"`
Form int `json:"form,omitempty"`
GenderRequirement int `json:"gender_requirement,omitempty"`
} |
Add ability to automatically save a cached version of MasterFile after successful fetch.