From fd222f1dc783d38a473adcab855aa8cd3dab6fbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laure=CE=B7t?= Date: Tue, 13 Apr 2021 19:19:05 +0200 Subject: [PATCH] fix: some javadoc --- core/src/sagittarius/model/BaseActor.java | 5 ++++- core/src/sagittarius/model/Player.java | 14 +++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/core/src/sagittarius/model/BaseActor.java b/core/src/sagittarius/model/BaseActor.java index 31fde84..ecaa0ef 100644 --- a/core/src/sagittarius/model/BaseActor.java +++ b/core/src/sagittarius/model/BaseActor.java @@ -10,6 +10,9 @@ public abstract class BaseActor extends Actor { static private BitmapFont fontDebug = new BitmapFont(); + /** + * @return debug String displayed in {@link #draw()} + */ protected abstract String getInfo(); protected float angle; // encapsulate ? @@ -17,7 +20,7 @@ public abstract class BaseActor extends Actor { @Override public void draw(Batch batch, float parentAlpha) { super.draw(batch, parentAlpha); - fontDebug.draw(batch, getInfo(), getX(), getY()); + if (getDebug()) fontDebug.draw(batch, getInfo(), getX(), getY()); } @Override diff --git a/core/src/sagittarius/model/Player.java b/core/src/sagittarius/model/Player.java index c99aa9d..f7174c7 100644 --- a/core/src/sagittarius/model/Player.java +++ b/core/src/sagittarius/model/Player.java @@ -57,13 +57,6 @@ public class Player extends BaseActor { bow.act(dt); } - /** - * @return the Player's home Planet. - */ - Planet getHome() { - return this.home; - } - @Override protected String getInfo() { return @@ -71,4 +64,11 @@ public class Player extends BaseActor { ; } + /** + * @return the Player's home Planet. + */ + Planet getHome() { + return this.home; + } + }