Elder Scrolls: Legends SDK - Java

A java wrapper around the Elder Scrolls: Legends API of https://elderscrollslegends.io

License

License

Categories

Categories

Java Languages Net
GroupId

GroupId

net.markjfisher
ArtifactId

ArtifactId

elderscrolls-legends-sdk-java
Last Version

Last Version

1.1.7
Release Date

Release Date

Type

Type

jar
Description

Description

Elder Scrolls: Legends SDK - Java
A java wrapper around the Elder Scrolls: Legends API of https://elderscrollslegends.io
Project URL

Project URL

https://github.com/markjfisher/elder-scrolls-legends-sdk-java
Source Code Management

Source Code Management

https://github.com/markjfisher/elder-scrolls-legends-sdk-java

Download elderscrolls-legends-sdk-java

How to add to project

<!-- https://jarcasting.com/artifacts/net.markjfisher/elderscrolls-legends-sdk-java/ -->
<dependency>
    <groupId>net.markjfisher</groupId>
    <artifactId>elderscrolls-legends-sdk-java</artifactId>
    <version>1.1.7</version>
</dependency>
// https://jarcasting.com/artifacts/net.markjfisher/elderscrolls-legends-sdk-java/
implementation 'net.markjfisher:elderscrolls-legends-sdk-java:1.1.7'
// https://jarcasting.com/artifacts/net.markjfisher/elderscrolls-legends-sdk-java/
implementation ("net.markjfisher:elderscrolls-legends-sdk-java:1.1.7")
'net.markjfisher:elderscrolls-legends-sdk-java:jar:1.1.7'
<dependency org="net.markjfisher" name="elderscrolls-legends-sdk-java" rev="1.1.7">
  <artifact name="elderscrolls-legends-sdk-java" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.markjfisher', module='elderscrolls-legends-sdk-java', version='1.1.7')
)
libraryDependencies += "net.markjfisher" % "elderscrolls-legends-sdk-java" % "1.1.7"
[net.markjfisher/elderscrolls-legends-sdk-java "1.1.7"]

Dependencies

runtime (5)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.3.30
org.apache.httpcomponents : httpclient-cache jar 4.5.8
com.konghq : unirest-java jar 2.2.00
com.fasterxml.jackson.module : jackson-module-kotlin jar 2.9.8
com.natpryce : konfig jar 1.6.10.0

Project Modules

There are no modules declared in this project.

This is the Elder Scrolls: Legends SDK Java implementation.

It is a wrapper around the Elder Scrolls: Legends API of https://elderscrollslegends.io.

Including in your project

Gradle/maven dependency

Latest version is 1.1.6

Approach Instruction
Gradle
implementation "net.markjfisher:elderscrolls-legends-sdk-java:{version}"
Gradle (Kotlin DSL)
implementation("net.markjfisher:elderscrolls-legends-sdk-java:{version}")
Maven
<dependency>
    <groupId>net.markjfisher</groupId>
    <artifactId>elderscrolls-legends-sdk-java</artifactId>
    <version>{version}</version>
</dependency>

Example usage

The following illustrates using all(), where() and find().

public class Legends {
	public static void main(String args[]) {
		System.out.println(Keyword.all());

		System.out.println(Card.find("3921e71a0b3a5f30032d54d402cefb37b60aa46e"));

		Map<String, String> cardQuery = Map.of(
			"attributes", "strength",
			"keywords", "guard");

		Card.where(cardQuery)
			.forEach(System.out::println);

		Set.all()
			.stream()
			.filter(set -> set.getTotalCards() > 100)
			.forEach(System.out::println);

		Deck deck = Deck.importCode("SPADhlfvoFAEqEcfkvdhANdqdQeYlDmGnMlLpTitldmCpZsp");
		printDetails(deck);

		Collection c = Collection.importCode("SP!#hlfv!#qEcf!#bkiP");
		printDetails(c);

		CardCache.load(); // Load all cards into cache - useful if you have long running process doing export code lookups
		// Goblin skulk by export code, or sdk Id.
		Card c1 = CardCache.findByCode("hl"); // Use export code to find a card
		Card c2 = CardCache.findById("2413799c807377f860cd9fe2e6c472bdbb1360a7"); // Use sdk Id to find a card
	}

	private static void printDetails(CardGrouping c) {
		IntStream.rangeClosed(1, 3)
				.peek( i -> System.out.println("============== " + i + " Of ================"))
				.mapToObj(c::of)
				.forEach(cards -> cards.forEach(card ->
						System.out.println(String.format("%s\n       Set: %s\n    Rarity: %s\n", card.getName(), card.getSet().getName(), card.getRarity()))
				));
	}

}

SDK

See SDK Usage

Locally Building

Ensure you have Java 8+ installed (e.g. via SdkMan)

./gradlew

Underlying implementation details

This library uses Unirest for low level client connection.

This sdk was developed in Kotlin.

Versions

Version
1.1.7
1.1.6
1.1.5
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0