All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hirezapi.smite.endpoint.SmiteEndpoint Maven / Gradle / Ivy

The newest version!
package hirezapi.smite.endpoint;

import hirezapi.HiRezApi;
import hirezapi.endpoints.GameEndpoint;
import hirezapi.enums.Language;
import hirezapi.smite.json.God;
import hirezapi.smite.json.GodItem;
import hirezapi.smite.json.GodRecommendedItem;
import hirezapi.smite.json.GodSkin;

import java.util.Arrays;
import java.util.List;

public class SmiteEndpoint extends GameEndpoint {
  public SmiteEndpoint(HiRezApi api) {
    super(api);
  }

  /**
   * List all available gods.
   * @param language Language code
   * @return List all in game gods
   */
  public List getGods(Language language) {
    return Arrays.asList(api.getRestController()
          .request(buildUrl("getgods",
                Integer.toString(language.getId())), God[].class));
  }

  /**
   * Getting Recommended items for specific god.
   * @param god the god
   * @param language Language Code
   * @return List all recommended items for specific god
   */
  public List getRecommendedItems(God god, Language language) {
    return Arrays.asList(api.getRestController()
          .request(buildUrl("getgodrecommendeditems",
                Long.toString(god.getId()),
                Integer.toString(language.getId())), GodRecommendedItem[].class));
  }

  @Override
  public List getSkins(long id, Language language) {
    return Arrays.asList(api.getRestController()
          .request(buildUrl("getgodskins",
                Long.toString(id),
                Integer.toString(language.getId())), GodSkin[].class));
  }

  @Override
  public List getItems(Language language) {
    return Arrays.asList(api.getRestController()
          .request(buildUrl("getitems",
                Integer.toString(language.getId())), GodItem[].class));
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy