projects
/
zzz-pokedex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
64c7edc
)
Add a SaveFilePokemon accessor to get the form.
author
Eevee
<git@veekun.com>
Sun, 6 Mar 2011 00:04:05 +0000
(16:04 -0800)
committer
Eevee
<git@veekun.com>
Wed, 9 Mar 2011 06:28:33 +0000
(22:28 -0800)
pokedex/struct/__init__.py
patch
|
blob
|
history
diff --git
a/pokedex/struct/__init__.py
b/pokedex/struct/__init__.py
index
54a81f2
..
962377f
100644
(file)
--- a/
pokedex/struct/__init__.py
+++ b/
pokedex/struct/__init__.py
@@
-105,6
+105,10
@@
class SaveFilePokemon(object):
st = self.structure
self._pokemon = session.query(tables.Pokemon).get(st.national_id)
st = self.structure
self._pokemon = session.query(tables.Pokemon).get(st.national_id)
+ self._pokemon_form = session.query(tables.PokemonForm) \
+ .with_parent(self._pokemon) \
+ .filter_by(name=st.alternate_form) \
+ .one()
self._ability = self._session.query(tables.Ability).get(st.ability_id)
growth_rate = self._pokemon.evolution_chain.growth_rate
self._ability = self._session.query(tables.Ability).get(st.ability_id)
growth_rate = self._pokemon.evolution_chain.growth_rate
@@
-189,6
+193,10
@@
class SaveFilePokemon(object):
return self._pokemon
@property
return self._pokemon
@property
+ def species_form(self):
+ return self._pokemon_form
+
+ @property
def pokeball(self):
return self._pokeball
def pokeball(self):
return self._pokeball