mirror of
https://github.com/tribufu/tribufu-java
synced 2026-05-06 14:57:27 +00:00
Add some types and test make resquests
This commit is contained in:
parent
8a45692208
commit
3e6f8251a7
12 changed files with 310 additions and 2 deletions
20
examples/build.gradle
Normal file
20
examples/build.gradle
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
plugins {
|
||||
id 'application'
|
||||
}
|
||||
|
||||
version = "0.0.4"
|
||||
archivesBaseName = "TribufuExample"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(':lib')
|
||||
implementation 'com.google.guava:guava:30.0-jre'
|
||||
testImplementation 'junit:junit:4.13.1'
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass = 'com.tribufu.example.ExampleApp'
|
||||
}
|
||||
23
examples/src/main/java/com/tribufu/example/ExampleApp.java
Normal file
23
examples/src/main/java/com/tribufu/example/ExampleApp.java
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
|
||||
package com.tribufu.example;
|
||||
|
||||
import com.tribufu.TribufuApi;
|
||||
|
||||
public class ExampleApp {
|
||||
public static void main(String[] args) {
|
||||
var api = new TribufuApi();
|
||||
|
||||
var games = api.getGames();
|
||||
System.out.println("\n---- GAMES ----");
|
||||
for (var game : games) {
|
||||
System.out.println(game.name);
|
||||
}
|
||||
|
||||
var servers = api.getServers();
|
||||
System.out.println("\n---- SERVERS ----");
|
||||
for (var server : servers) {
|
||||
System.out.println(server.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue