https://github.com/javadev/undescriptive-project
Dragons of Mugloar solution
https://github.com/javadev/undescriptive-project
Last synced: 9 days ago
JSON representation
Dragons of Mugloar solution
- Host: GitHub
- URL: https://github.com/javadev/undescriptive-project
- Owner: javadev
- License: mit
- Created: 2016-07-14T14:59:31.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-10-12T20:58:32.000Z (over 4 years ago)
- Last Synced: 2025-03-26T07:09:25.842Z (3 months ago)
- Language: Java
- Homepage:
- Size: 1.4 MB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dragons of Mugloar solution
Simple java library to solve Dragons of Mugloar game.[](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.github.javadev%22%20AND%20a%3A%22Dragons-of-Mugloar-solution%22)
[ ](https://github.com/javadev/undescriptive-project/blob/master/LICENSE)
[](https://travis-ci.org/javadev/undescriptive-project)
[](https://coveralls.io/r/javadev/undescriptive-project)
[](http://codecov.io/github/javadev/undescriptive-project?branch=master)
[](https://www.codacy.com/app/javadev75/undescriptive-project?utm_source=github.com&utm_medium=referral&utm_content=javadev/undescriptive-project&utm_campaign=Badge_Grade)[](https://gitter.im/javadev/undescriptive-project?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
1. [Add new module to your project](#1-add-new-module-to-your-project)
2. [Create client](#2-create-client)
3. [Load a game](#3-load-a-game)
4. [Load weather information](#4-load-weather-information)
5. [Generate game solution](#5-generate-game-solution)
6. [Submit solution to a server](#6-submit-solution-to-a-server)
7. [Check results](#7-check-results)###1. Add new module to your project
Include the following in your `pom.xml` for Maven:```
com.github.javadev
Dragons-of-Mugloar-solution
1.2
...```
###2. Create client
```java
GameClient client = HttpClient.createDefault();
```###3. Load a game
```java
Map game = client.getGame();
```###4. Load weather information
```java
Map weatherResponse = client.getWeather((Long) $.get(game, "gameId"));
```###5. Generate game solution
```java
final Map request = client.generateGameSolution((Map) $.get(game, "knight"), weatherResponse);
```###6. Submit solution to a server
```java
Map response = client.sendSolution((Long) $.get(game, "gameId"), request);
```###7. Check results
```java
if ("Victory".equals((String) $.get(response, "status"))) {
// We win a game
} else if ("SRO".equals((String) $.get(weatherResponse, "code"))) {
// Storm weather
}
```