An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

        

# Dragons of Mugloar solution
Simple java library to solve Dragons of Mugloar game.

[![Maven Central](https://img.shields.io/maven-central/v/com.github.javadev/Dragons-of-Mugloar-solution.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.github.javadev%22%20AND%20a%3A%22Dragons-of-Mugloar-solution%22)
[![MIT License](http://img.shields.io/badge/license-MIT-green.svg) ](https://github.com/javadev/undescriptive-project/blob/master/LICENSE)
[![Build Status](https://secure.travis-ci.org/javadev/undescriptive-project.svg)](https://travis-ci.org/javadev/undescriptive-project)
[![Coverage Status](https://coveralls.io/repos/javadev/undescriptive-project/badge.svg?branch=master)](https://coveralls.io/r/javadev/undescriptive-project)
[![codecov.io](http://codecov.io/github/javadev/undescriptive-project/coverage.svg?branch=master)](http://codecov.io/github/javadev/undescriptive-project?branch=master)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/1ef9ebbd64c64745915d78621af8bb7a)](https://www.codacy.com/app/javadev75/undescriptive-project?utm_source=github.com&utm_medium=referral&utm_content=javadev/undescriptive-project&utm_campaign=Badge_Grade)

[![Join the chat at https://gitter.im/javadev/undescriptive-project](https://badges.gitter.im/Join%20Chat.svg)](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
}
```