From 8d854c03f09c21895692d77d6900e062cee487f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 9 Jun 2020 09:35:48 +0200 Subject: Piece : add roadMarchBonus(), reorder code --- core/src/ch/asynk/gdx/boardgame/Piece.java | 37 +++++++++++++++++------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/core/src/ch/asynk/gdx/boardgame/Piece.java b/core/src/ch/asynk/gdx/boardgame/Piece.java index 5f47309..970bf8a 100644 --- a/core/src/ch/asynk/gdx/boardgame/Piece.java +++ b/core/src/ch/asynk/gdx/boardgame/Piece.java @@ -29,6 +29,27 @@ public class Piece implements Drawable, Positionable, Rotable, Scalable setHead(texture); } + public int getAvailableMP() + { + return 0; + } + + public int moveCost(Tile from, Tile to, Orientation orientation) + { + // Integer.MAX_VALUE means impracticable + return Integer.MAX_VALUE; + } + + public boolean atLeastOneTileMove() + { + return true; + } + + public int roadMarchBonus() + { + return 0; + } + public void setHead(Texture texture) { sprite = new Sprite(texture); @@ -123,20 +144,4 @@ public class Piece implements Drawable, Positionable, Rotable, Scalable float h = getHeight(); shapeRenderer.rect(getX(), getY(), (w / 2f), (h / 2f), w, h, sprite.getScaleX(), sprite.getScaleY(), getRotation()); } - - public int getAvailableMP() - { - return 0; - } - - public int moveCost(Tile from, Tile to, Orientation orientation) - { - // Integer.MAX_VALUE means impracticable - return Integer.MAX_VALUE; - } - - public boolean atLeastOneTileMove() - { - return true; - } } -- cgit v1.1-2-g2b99