(self)
| 1358 | raise FileIOException("Unexpected error writing to {}".web_inventory) |
| 1359 | |
| 1360 | def jsonify_inventory(self): |
| 1361 | json_inventory = [] |
| 1362 | |
| 1363 | json_inventory.append({"inventory_item_data": {"player_stats": self.player.player_stats}}) |
| 1364 | |
| 1365 | for pokedex in self.pokedex.all(): |
| 1366 | json_inventory.append({"inventory_item_data": {"pokedex_entry": pokedex}}) |
| 1367 | |
| 1368 | for family_id, candy in self.candy._data.items(): |
| 1369 | json_inventory.append({"inventory_item_data": {"candy": {"family_id": family_id, "candy": candy.quantity}}}) |
| 1370 | |
| 1371 | for item_id, item in self.items._data.items(): |
| 1372 | json_inventory.append({"inventory_item_data": {"item": {"item_id": item_id, "count": item.count}}}) |
| 1373 | |
| 1374 | for pokemon in self.pokemons.all_with_eggs(): |
| 1375 | json_inventory.append({"inventory_item_data": {"pokemon_data": pokemon._data}}) |
| 1376 | |
| 1377 | for inc in self.egg_incubators: |
| 1378 | json_inventory.append({"inventory_item_data": inc}) |
| 1379 | |
| 1380 | # for item in self.applied_items: |
| 1381 | # json_inventory.append({"inventory_applied_item_data": {"applied_item": {"item_id": item.item_id, "applied_ms": item.applied_ms, "expire_ms": item.expire_ms}}}) |
| 1382 | |
| 1383 | return json_inventory |
| 1384 | |
| 1385 | def retrieve_inventories_size(self): |
| 1386 | """ |
no test coverage detected