mirror of
https://github.com/mm201/pkmn-classic-framework.git
synced 2026-05-06 05:17:32 -05:00
Expose Pokedex.Species as an IDictionary.
This commit is contained in:
parent
855bd9eb88
commit
320fc26a2a
|
|
@ -172,10 +172,13 @@ namespace PkmnFoundations.Pokedex
|
|||
|
||||
private Dictionary<LocationNumbering, Dictionary<int, Location>> m_location_values_generations;
|
||||
|
||||
// todo: add ReadOnlyIndexer1d class, replace these methods with them
|
||||
public Species Species(int national_dex)
|
||||
// todo: use readonly wrappers
|
||||
public IDictionary<int, Species> Species
|
||||
{
|
||||
return m_species[national_dex];
|
||||
get
|
||||
{
|
||||
return m_species;
|
||||
}
|
||||
}
|
||||
|
||||
public Family Families(int id)
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ namespace PkmnFoundations.Pokedex
|
|||
// since we want the Pokemon4/5 ctor to succeed regardless of how
|
||||
// broken the underlying data is.
|
||||
return new LazyKeyValuePair<int, Species>(
|
||||
k => k == 0 ? null : (pokedex == null ? null : pokedex.Species(k)),
|
||||
k => k == 0 ? null : (pokedex == null ? null : pokedex.Species[k]),
|
||||
v => v == null ? 0 : v.NationalDex);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ namespace PkmnFoundations.GTS
|
|||
{
|
||||
Pokedex.Pokedex pokedex = AppStateHelper.Pokedex(Application);
|
||||
GtsRecordBase record = (GtsRecordBase)DataItem;
|
||||
return Common.HtmlEncode(pokedex.Species(record.Species).Name.ToString());
|
||||
return Common.HtmlEncode(pokedex.Species[record.Species].Name.ToString());
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
@ -216,7 +216,7 @@ namespace PkmnFoundations.GTS
|
|||
{
|
||||
Pokedex.Pokedex pokedex = AppStateHelper.Pokedex(Application);
|
||||
GtsRecordBase record = (GtsRecordBase)DataItem;
|
||||
Species species = pokedex.Species(record.RequestedSpecies);
|
||||
Species species = pokedex.Species[record.RequestedSpecies];
|
||||
|
||||
return "<img src=\"" + ResolveUrl(WebFormat.SpeciesImageSmall(species)) +
|
||||
"\" alt=\"" + Common.HtmlEncode(species.Name.ToString()) +
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user