summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2020-06-03 18:02:05 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2020-06-03 18:02:05 +0200
commit0d121cac76bc84eb5238140f922f3ef1782d0910 (patch)
tree23b80238e3d5d3b1a73fa2ac52a42a1f537687c1 /core/src
parentc3cc1a9a66b944179c759e112272912d87decf13 (diff)
downloadgdx-boardgame-0d121cac76bc84eb5238140f922f3ef1782d0910.zip
gdx-boardgame-0d121cac76bc84eb5238140f922f3ef1782d0910.tar.gz
Board : add distance(…) default to Geometry.EUCLIDEAN
Diffstat (limited to 'core/src')
-rw-r--r--core/src/ch/asynk/gdx/boardgame/boards/Board.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/boards/Board.java b/core/src/ch/asynk/gdx/boardgame/boards/Board.java
index 020d12a..6d8d1b5 100644
--- a/core/src/ch/asynk/gdx/boardgame/boards/Board.java
+++ b/core/src/ch/asynk/gdx/boardgame/boards/Board.java
@@ -30,6 +30,11 @@ public interface Board extends TileKeyGenerator
}
public float distance(int x0, int y0, int x1, int y1, Geometry geometry);
+ default public float distance(int x0, int y0, int x1, int y1)
+ {
+ return distance(x0, y0, x1, y1, Geometry.EUCLIDEAN);
+ }
+
default public void dropInPlace(Piece piece, Vector2 v)
{
toBoard(piece.getCX(), piece.getCY(), v);