Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Species.legendaries and Species.ultrabeasts always return an empty array #25

Closed
Sayakie opened this issue Mar 24, 2022 · 1 comment · Fixed by #27
Closed

Species.legendaries and Species.ultrabeasts always return an empty array #25

Sayakie opened this issue Mar 24, 2022 · 1 comment · Fixed by #27

Comments

@Sayakie
Copy link
Owner

Sayakie commented Mar 24, 2022

Reading Species#legendaries and Species#ultrabests will always return an empty array that its length is 0.

protected static readonly legendaries: Species[] = []
protected static readonly ultrabeasts: Species[] = []

This is caused by SpeciesImpl static initialization step just concats an array, and not set again.

static {
Species.legendaries.concat([
Species.MissingNo,
/** Generation 1 */
Species.Articuno,
Species.Zapdos,
Species.Moltres,
Species.Mewtwo,
Species.Mew,
/** Generation 2 */
Species.Raikou,
Species.Entei,
Species.Suicune,
Species.Lugia,
Species.Hooh,
Species.Celebi,
/** Generation 3 */
Species.Regirock,
Species.Regice,
Species.Registeel,
Species.Latias,
Species.Latios,
Species.Kyogre,
Species.Groudon,
Species.Rayquaza,
Species.Jirachi,
/** Generation 4 */
Species.Uxie,
Species.Mesprit,
Species.Azelf,
Species.Dialga,
Species.Palkia,
Species.Heatran,
Species.Regigigas,
Species.Giratina,
/** Generation 5 */
Species.Cobalion,
Species.Terrakion,
Species.Virizion,
Species.Tornadus,
Species.Thundurus,
Species.Landorus,
/** Generation 6 */
Species.Xerneas,
Species.Yveltal,
Species.Zygarde,
Species.Diancie,
Species.Hoopa,
Species.Volcanion,
/** Generation 7 */
Species.TypeNull,
Species.Silvally,
Species.TapuKoko,
Species.TapuLele,
Species.TapuBulu,
Species.TapuFini,
Species.Cosmog,
Species.Cosmoem,
Species.Solgaleo,
Species.Lunala,
Species.Necrozma,
Species.Marshadow,
Species.Magearna,
Species.Zeraora,
Species.Meltan,
Species.Melmetal,
/** Generation 8 */
Species.Zacian,
Species.Zamazenta,
Species.Eternatus,
Species.Kubfu,
Species.Urshifu,
Species.Zarude,
Species.Regieleki,
Species.Regidrago,
Species.Glastrier,
Species.Spectrier,
Species.Calyrex
])
Species.ultrabeasts.concat([
Species.Blacephalon,
Species.Buzzwole,
Species.Celesteela,
Species.Guzzlord,
Species.Poipole,
Species.Naganadel,
Species.Nihilego,
Species.Pheromosa,
Species.Kartana,
Species.Stakataka,
Species.Xurkitree
])
}

@Sayakie
Copy link
Owner Author

Sayakie commented Mar 24, 2022

And each species are unique and singleton, so look good to set their type to Set<Species>. But we also needs to notice about the type would be changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant