summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2018-09-14 15:33:36 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2018-09-14 15:33:40 +0200
commit5fdda950db81e52afdec1c70e2b3a5fbe7947bc8 (patch)
tree33f490516646189d86ab1369cc2b43c9fa428849 /core/src
parentb35b61953623857f911255a88a6f2268076ee8ad (diff)
downloadgdx-boardgame-5fdda950db81e52afdec1c70e2b3a5fbe7947bc8.zip
gdx-boardgame-5fdda950db81e52afdec1c70e2b3a5fbe7947bc8.tar.gz
coding style
Diffstat (limited to 'core/src')
-rw-r--r--core/src/ch/asynk/gdx/board/board/HexBoard.java16
1 files 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)) {