From cebc564fa403bb2c215b4833400cbfb283d1077f Mon Sep 17 00:00:00 2001 From: SimonIT Date: Sat, 30 Nov 2019 22:53:20 +0100 Subject: remove string format, it's not available on gwt --- core/src/ch/asynk/gdx/boardgame/Path.java | 7 ++++--- core/src/ch/asynk/gdx/boardgame/Tile.java | 2 +- core/src/ch/asynk/gdx/boardgame/animations/FireAnimation.java | 2 +- core/src/ch/asynk/gdx/boardgame/boards/BoardFactory.java | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/core/src/ch/asynk/gdx/boardgame/Path.java b/core/src/ch/asynk/gdx/boardgame/Path.java index c7f0b19..10b26c9 100644 --- a/core/src/ch/asynk/gdx/boardgame/Path.java +++ b/core/src/ch/asynk/gdx/boardgame/Path.java @@ -3,6 +3,7 @@ package ch.asynk.gdx.boardgame; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.utils.Pool; import com.badlogic.gdx.utils.Disposable; +import com.badlogic.gdx.utils.StringBuilder; import ch.asynk.gdx.boardgame.utils.IterableArray; @@ -53,10 +54,10 @@ public class Path extends IterableArray implements Disposable, Pool.Poolab @Override public String toString() { - String s = String.format(" o:%s\n", finalOrientation); + StringBuilder s = new StringBuilder(" o:").append(finalOrientation).append("\n"); for (Tile t : this) - s += String.format(" %s\n", t.toString()); - return s; + s.append(" ").append(t).append("\n"); + return s.toString(); } public Tile from() diff --git a/core/src/ch/asynk/gdx/boardgame/Tile.java b/core/src/ch/asynk/gdx/boardgame/Tile.java index 5c07866..dda0307 100644 --- a/core/src/ch/asynk/gdx/boardgame/Tile.java +++ b/core/src/ch/asynk/gdx/boardgame/Tile.java @@ -39,6 +39,6 @@ public class Tile implements Drawable @Override public String toString() { - return String.format("[%4d, %4d]", (int)x, (int)y); + return "[" + x + ", " + y + "]"; } } diff --git a/core/src/ch/asynk/gdx/boardgame/animations/FireAnimation.java b/core/src/ch/asynk/gdx/boardgame/animations/FireAnimation.java index 1bedb10..d8cf5d7 100644 --- a/core/src/ch/asynk/gdx/boardgame/animations/FireAnimation.java +++ b/core/src/ch/asynk/gdx/boardgame/animations/FireAnimation.java @@ -104,7 +104,7 @@ public class FireAnimation implements Animation, Pool.Poolable Config cfg = configs.get(configName); if (cfg == null) { - throw new RuntimeException(String.format("FireAnimation : no configuration named : '%s'", configName)); + throw new RuntimeException("FireAnimation : no configuration named : '" + configName + "'"); } a.compute(cfg, x0, y0, x1, y1); diff --git a/core/src/ch/asynk/gdx/boardgame/boards/BoardFactory.java b/core/src/ch/asynk/gdx/boardgame/boards/BoardFactory.java index 8eba838..54eaf38 100644 --- a/core/src/ch/asynk/gdx/boardgame/boards/BoardFactory.java +++ b/core/src/ch/asynk/gdx/boardgame/boards/BoardFactory.java @@ -41,7 +41,7 @@ public class BoardFactory break; } if (board == null) { - throw new RuntimeException( String.format("%s board type is not implemented yet.", boardType) ); + throw new RuntimeException(boardType + " board type is not implemented yet."); } Orientation.setValues(board.getAngles()); -- cgit v1.1-2-g2b99 From 9900cd77491a40158dcefbf0da1e6c29cfd4eb45 Mon Sep 17 00:00:00 2001 From: SimonIT Date: Sat, 30 Nov 2019 23:03:54 +0100 Subject: add assets directory to resources to not have to change the working directory --- test/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/test/build.gradle b/test/build.gradle index 55ac893..d242c6c 100644 --- a/test/build.gradle +++ b/test/build.gradle @@ -4,6 +4,7 @@ apply plugin: "java" sourceCompatibility = 1.8 sourceSets.main.java.srcDirs = [ "src/" ] +sourceSets.main.resources.srcDirs += [ "../assets/data/" ] project.ext.mainClassName = "ch.asynk.gdx.boardgame.test.DesktopLauncher" project.ext.assetsDir = new File("../assets/data"); -- cgit v1.1-2-g2b99 From 47f52b84fad37e3b02241364291944da33e10e7a Mon Sep 17 00:00:00 2001 From: SimonIT Date: Sun, 1 Dec 2019 12:37:15 +0100 Subject: Some install instructions --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index c2df9ae..6581c57 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,30 @@ code is mainly extracted from https://github.com/jeremyz/rustanddust - various animations - path, movement, line of sight computation +## install + +Add the repository: +```groovy + allprojects { + repositories { + maven { url 'https://jitpack.io' } + } + } +``` +Add the dependency to all subprojects: (You can replace `master-SNAPSHOT` with a tag from github) +```groovy + dependencies { + implementation 'com.github.jeremyz:gdx-boardgame:master-SNAPSHOT' + } +``` +If you use the html module, you have to add also this module to its dependencies: +```groovy + dependencies { + implementation 'com.github.jeremyz:gdx-boardgame:master-SNAPSHOT:sources' + } +``` + +For the html build, you have to add this line to your *.gwt.xml files in the html project: +```xml + +``` -- cgit v1.1-2-g2b99 From 557bbc62f8d055c247b8d94c77a8504887dcdb6f Mon Sep 17 00:00:00 2001 From: SimonIT Date: Sun, 1 Dec 2019 13:00:00 +0100 Subject: Link to javadocs --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 6581c57..a840407 100644 --- a/README.md +++ b/README.md @@ -39,3 +39,7 @@ For the html build, you have to add this line to your *.gwt.xml files in the htm ```xml ``` + +## javadoc + +[Latest](https://javadoc.jitpack.io/com/github/jeremyz/gdx-boardgame/master-SNAPSHOT/javadoc/) -- cgit v1.1-2-g2b99 From 59cd5fadf23b7036e0897f6e575ac0e9cd2fe279 Mon Sep 17 00:00:00 2001 From: SimonIT Date: Sun, 1 Dec 2019 13:02:40 +0100 Subject: fix indentation --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a840407..5a67a5f 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,9 @@ Add the dependency to all subprojects: (You can replace `master-SNAPSHOT` with a ``` If you use the html module, you have to add also this module to its dependencies: ```groovy - dependencies { - implementation 'com.github.jeremyz:gdx-boardgame:master-SNAPSHOT:sources' - } + dependencies { + implementation 'com.github.jeremyz:gdx-boardgame:master-SNAPSHOT:sources' + } ``` For the html build, you have to add this line to your *.gwt.xml files in the html project: -- cgit v1.1-2-g2b99