Created
February 20, 2018 20:21
-
-
Save IanLeatherbury/1dc1af2f54cc28b22fe2b30e9253a816 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Pokedex(object): | |
def __init__(self, pokemon): | |
self.pokemon = pokemon | |
class Pokemon(object): | |
def __init__(self, | |
prev_evolution="value", | |
name="", | |
img="value", | |
spawn_chance="value", | |
egg="value", | |
weaknesses="value", | |
weight="value", | |
height="value", | |
candy_count="value", | |
avg_spawns="value", | |
num="value", | |
candy="value", | |
spawn_time="value", | |
next_evolution="value", | |
multipliers="value", | |
type="value", | |
id="value"): | |
self.prev_evolution = prev_evolution | |
self.name = name | |
self.img = img | |
self.spawn_chance = spawn_chance | |
self.egg = egg | |
self.weaknesses = weaknesses | |
self.weight = weight | |
self.height = height | |
self.candy_count = candy_count | |
self.avg_spawns = avg_spawns | |
self.num = num | |
self.candy = candy | |
self.spawn_time = spawn_time | |
self.next_evolution = next_evolution | |
self.multipliers = multipliers | |
self.type = type | |
self.id = id | |
def pokedex_from_json(p): | |
return [Pokemon(**x) for x in p['pokemon']] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment