Open kipyin opened 5 years ago
OK, but can we have two Pokémon, one is official and the other is not at the same time? For example, can official_mew
interact with customized_mew
? What is the key difference between these two mew
s?
Adding an official argument to Pokemon()
is better, since the "official" flag is tied to each individual Pokémon, not to all Pokémon.
Currently, the
Pokemon
class will enforce all attributes and methods conform with the official data, and the users are not able to alter the attribute values whatsoever.Conforming to the official data is a good practice, but what if the "official data" is wrong? Or what if the users want to make their own Pokémon world? In these cases, with the current design, the users only have one option: make and use their own database. This option will solve the first problem, but will not always solve the second, because the users have to use the database schema that veekun has designed.
Adding a
Pokemon.OFFICIAL
class variable as a switch will solve this issue:In the methods, we can also add an
if-else
block that checks the setting: