Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.dh.apichecker;
- import io.swagger.client.api.UniverseApi;
- import io.swagger.client.model.GetUniverseRaces200Ok;
- import java.util.List;
- import static org.dh.apichecker.Main.ap;
- public class race {
- //Race Vars
- static int race_id;
- static String name;
- static String description;
- static int alliance_id;
- //Race Vars
- //Race Constructor
- public race(int race_id) {
- this.race_id = race_id;
- buildRace(race_id);
- }
- //Race Constructor
- ////////////////////////////////////
- public static void buildRace(int race_id){
- try {
- List<GetUniverseRaces200Ok> resp =
- new UniverseApi(ap).getUniverseRaces(null, null, null, null);
- for(GetUniverseRaces200Ok race : resp) {
- if (race.getRaceId() == race_id) {
- name = race.getName();
- description = race.getDescription();
- alliance_id = race.getAllianceId();
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- ////////////////////////////////////
- //Race Getters
- public int getRace_id() {
- return race_id;
- }
- public String getName() {
- return name;
- }
- public String getDescription() {
- return description;
- }
- public int getAlliance_id() {
- return alliance_id;
- }
- //Race Getters
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement