From 4f65862177c5fb91df02370b776564a2f73816de Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Sun, 29 Sep 2019 22:18:17 -0300 Subject: [PATCH] Add missing documenation Remove language from game panel Signed-off-by: Chris Cromer --- src/cl/cromer/azaraka/Celda.java | 29 +++++++++++++++++++++ src/cl/cromer/azaraka/object/Enemy.java | 18 +++++++++++++ src/cl/cromer/azaraka/object/Gem.java | 6 +++++ src/cl/cromer/azaraka/object/Portal.java | 6 +++++ src/cl/cromer/azaraka/panel/Game.java | 8 ------ src/cl/cromer/azaraka/sprite/Animation.java | 27 +++++++++++++++++++ 6 files changed, 86 insertions(+), 8 deletions(-) diff --git a/src/cl/cromer/azaraka/Celda.java b/src/cl/cromer/azaraka/Celda.java index d05e85c..72e01ad 100644 --- a/src/cl/cromer/azaraka/Celda.java +++ b/src/cl/cromer/azaraka/Celda.java @@ -127,11 +127,19 @@ public class Celda extends JComponent implements Constantes { textureNumbers.add(textureNumber); } + /** + * Remove the texture that is on the top of the stack + */ public void removeTopTexture() { textures.remove(textures.size() - 1); textureNumbers.remove(textureNumbers.size() - 1); } + /** + * Get the numbers of the textures + * + * @return Returns an array list containing the texture numbers + */ public ArrayList getTextureNumbers() { return textureNumbers; } @@ -194,12 +202,33 @@ public class Celda extends JComponent implements Constantes { * The possible types of cell that this could be */ public enum Type { + /** + * The player + */ PLAYER, + /** + * An enemy + */ ENEMY, + /** + * An empty space + */ SPACE, + /** + * The portal + */ PORTAL, + /** + * An obstacle + */ OBSTACLE, + /** + * A chest + */ CHEST, + /** + * A key + */ KEY } } \ No newline at end of file diff --git a/src/cl/cromer/azaraka/object/Enemy.java b/src/cl/cromer/azaraka/object/Enemy.java index ed28492..b4bdc04 100644 --- a/src/cl/cromer/azaraka/object/Enemy.java +++ b/src/cl/cromer/azaraka/object/Enemy.java @@ -173,6 +173,12 @@ public class Enemy extends Object implements Constantes { } } + /** + * If the enemy has found the player attack him + * + * @param x The x position of the player + * @param y The y position of the player + */ private void attackPlayer(int x, int y) { if (getEscenario().getCanvas().getPlayer().getHealth() > 0) { logger.info("Attacked player at x: " + x + " y: " + y); @@ -223,9 +229,21 @@ public class Enemy extends Object implements Constantes { * The possible directions the enemy can face */ public enum Direction { + /** + * The enemy is facing up + */ UP, + /** + * The enemy is facing down + */ DOWN, + /** + * The enemy is facing left + */ LEFT, + /** + * The enemy is facing right + */ RIGHT } } diff --git a/src/cl/cromer/azaraka/object/Gem.java b/src/cl/cromer/azaraka/object/Gem.java index f6d2a8e..4ad0da7 100644 --- a/src/cl/cromer/azaraka/object/Gem.java +++ b/src/cl/cromer/azaraka/object/Gem.java @@ -41,6 +41,12 @@ public class Gem extends Object { PURIFIED } + /** + * Initialize the gem object + * + * @param escenario The scene the gem is in + * @param celda The cell the gem is in + */ public Gem(Escenario escenario, Celda celda) { super(escenario, celda); } diff --git a/src/cl/cromer/azaraka/object/Portal.java b/src/cl/cromer/azaraka/object/Portal.java index 878d3aa..87a5c0d 100644 --- a/src/cl/cromer/azaraka/object/Portal.java +++ b/src/cl/cromer/azaraka/object/Portal.java @@ -127,7 +127,13 @@ public class Portal extends Object implements Constantes { * The current state of the portal */ public enum State { + /** + * The portal is active + */ ACTIVE, + /** + * The portal is inactive + */ INACTIVE } } diff --git a/src/cl/cromer/azaraka/panel/Game.java b/src/cl/cromer/azaraka/panel/Game.java index 2c15a8c..5bf1e53 100644 --- a/src/cl/cromer/azaraka/panel/Game.java +++ b/src/cl/cromer/azaraka/panel/Game.java @@ -52,12 +52,4 @@ public class Game extends JPanel implements Constantes { public Lienzo getCanvas() { return canvas; } - - /** - * The language to use in the game - */ - public enum Language { - ENGLISH, - SPANISH - } } diff --git a/src/cl/cromer/azaraka/sprite/Animation.java b/src/cl/cromer/azaraka/sprite/Animation.java index b698d44..c94e60c 100644 --- a/src/cl/cromer/azaraka/sprite/Animation.java +++ b/src/cl/cromer/azaraka/sprite/Animation.java @@ -213,14 +213,41 @@ public class Animation implements Cloneable, Constantes { * The sprite type */ public enum SpriteType { + /** + * The player animation + */ PLAYER, + /** + * The enemy animation + */ ENEMY, + /** + * The chest animation + */ CHEST, + /** + * The gem animation + */ GEM, + /** + * The key animation + */ KEY, + /** + * The heart animation + */ HEART, + /** + * The game over animation + */ GAME_OVER, + /** + * The inactive portal animation + */ INACTIVE_PORTAL, + /** + * The active portal animation + */ ACTIVE_PORTAL }