From c075340985d0a5b815cdfde847f32b418078d501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Fri, 14 Sep 2018 10:55:39 +0200 Subject: Hex/Square Board : values are final --- core/src/ch/asynk/gdx/board/board/HexBoard.java | 20 ++++++++++---------- core/src/ch/asynk/gdx/board/board/SquareBoard.java | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/src/ch/asynk/gdx/board/board/HexBoard.java b/core/src/ch/asynk/gdx/board/board/HexBoard.java index 9d56a7c..da81071 100644 --- a/core/src/ch/asynk/gdx/board/board/HexBoard.java +++ b/core/src/ch/asynk/gdx/board/board/HexBoard.java @@ -6,16 +6,16 @@ import ch.asynk.gdx.board.Board; public class HexBoard implements Board { - private float side; // length of the side of the hex - private float x0; // bottom left x offset - private float y0; // bottom left y offset - private BoardFactory.BoardOrientation orientation; - - private float w; // side to side orthogonal distance - private float dw; // half hex : w/2 - private float dh; // hex top : s/2 - private float h; // square height : s + dh - private float slope; // dh / dw + private final float side; // length of the side of the hex + private final float x0; // bottom left x offset + private final float y0; // bottom left y offset + private final BoardFactory.BoardOrientation orientation; + + private final float w; // side to side orthogonal distance + private final float dw; // half hex : w/2 + private final float dh; // hex top : s/2 + private final float h; // square height : s + dh + private final float slope; // dh / dw // BoardOrientation.VERTICAL : 2 vertical sides : 2 vertices pointing up and down // coordinates diff --git a/core/src/ch/asynk/gdx/board/board/SquareBoard.java b/core/src/ch/asynk/gdx/board/board/SquareBoard.java index f8da8d3..9485e20 100644 --- a/core/src/ch/asynk/gdx/board/board/SquareBoard.java +++ b/core/src/ch/asynk/gdx/board/board/SquareBoard.java @@ -6,9 +6,9 @@ import ch.asynk.gdx.board.Board; public class SquareBoard implements Board { - private float side; // length of the side of a square - private float x0; // bottom left x offset - private float y0; // bottom left y offset + private final float side; // length of the side of a square + private final float x0; // bottom left x offset + private final float y0; // bottom left y offset public SquareBoard(float side, float x0, float y0) { -- cgit v1.1-2-g2b99