try {
JSONArray stats = request.getJSONArray("stats");
for (int i = 0; i < stats.length(); i++) {
StatType s = StatType.valueOf(stats.getJSONObject(i).getString("stat"));
pokemon.statPoints(s, stats.getJSONObject(i).getInt("amount"));
}
}
catch (JSONException e) {
}