From 5fdda950db81e52afdec1c70e2b3a5fbe7947bc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Fri, 14 Sep 2018 15:33:36 +0200 Subject: coding style --- core/src/ch/asynk/gdx/board/board/HexBoard.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/core/src/ch/asynk/gdx/board/board/HexBoard.java b/core/src/ch/asynk/gdx/board/board/HexBoard.java index da81071..3fa4ba1 100644 --- a/core/src/ch/asynk/gdx/board/board/HexBoard.java +++ b/core/src/ch/asynk/gdx/board/board/HexBoard.java @@ -74,16 +74,12 @@ public class HexBoard implements Board // compute row float dy = y - this.y0; row = (int) (dy / this.h); - if (dy < 0.f) { - row -= 1; - } + if (dy < 0f) row -= 1; // compute col float dx = x - this.x0 + (row * this.dw); col = (int) (dx / this.w); - if (dx < 0f) { - col -= 1; - } + if (dx < 0f) col -= 1; // upper rectangle or hex body if (dy > ((row * this.h) + this.side)) { @@ -108,16 +104,12 @@ public class HexBoard implements Board // compute col float dx = x - this.x0; col = (int) (dx / this.h); - if (dx < 0.f) { - col -= 1; - } + if (dx < 0f) col -= 1; // compute row float dy = y - this.y0 + (col * this.dw); row = (int) (dy / this.w); - if (dy < 0f) { - row -= 1; - } + if (dy < 0f) row -= 1; // right rectangle or hex body if (dx > ((col * this.h) + this.side)) { -- cgit v1.1-2-g2b99