Add missing javadoc tags
Signed-off-by: Chris Cromer <chris@cromer.cl>
This commit is contained in:
parent
3534a3e621
commit
a61220d873
@ -85,6 +85,8 @@ public class Escenario extends JComponent implements Constantes {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the scene
|
* Initialize the scene
|
||||||
|
*
|
||||||
|
* @param canvas The canvas that this scene is in
|
||||||
*/
|
*/
|
||||||
public Escenario(Lienzo canvas) {
|
public Escenario(Lienzo canvas) {
|
||||||
logger = getLogger(this.getClass(), ESCENARIO_LOG_LEVEL);
|
logger = getLogger(this.getClass(), ESCENARIO_LOG_LEVEL);
|
||||||
|
@ -65,10 +65,13 @@ public class Enemy implements Runnable, Constantes {
|
|||||||
*/
|
*/
|
||||||
private Lock lock;
|
private Lock lock;
|
||||||
|
|
||||||
|
// TODO: the cell is not needed, just it's x and y position
|
||||||
/**
|
/**
|
||||||
* Initialize the enemy
|
* Initialize the enemy
|
||||||
*
|
*
|
||||||
* @param escenario The scene the enemy is in
|
* @param escenario The scene the enemy is in
|
||||||
|
* @param celda The cell this enemy is in
|
||||||
|
* @param lock The lock used to prevent the threads from conflicting
|
||||||
*/
|
*/
|
||||||
public Enemy(Escenario escenario, Celda celda, Lock lock) {
|
public Enemy(Escenario escenario, Celda celda, Lock lock) {
|
||||||
this.lock = lock;
|
this.lock = lock;
|
||||||
@ -88,7 +91,6 @@ public class Enemy implements Runnable, Constantes {
|
|||||||
public void setCoordinates(int x, int y) {
|
public void setCoordinates(int x, int y) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
celda.setCoords(x, y);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -44,6 +44,7 @@ public class Sound implements Constantes {
|
|||||||
* Load the sound
|
* Load the sound
|
||||||
*
|
*
|
||||||
* @param path The path to the sound resource
|
* @param path The path to the sound resource
|
||||||
|
* @throws SoundException Thrown if the sound file could not be loaded
|
||||||
*/
|
*/
|
||||||
public Sound(String path) throws SoundException {
|
public Sound(String path) throws SoundException {
|
||||||
this.path = path;
|
this.path = path;
|
||||||
@ -83,6 +84,7 @@ public class Sound implements Constantes {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Play the sound
|
* Play the sound
|
||||||
|
* @throws SoundException Thrown if the sound clip is null
|
||||||
*/
|
*/
|
||||||
public void play() throws SoundException {
|
public void play() throws SoundException {
|
||||||
if (sound == null) {
|
if (sound == null) {
|
||||||
@ -95,6 +97,7 @@ public class Sound implements Constantes {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop the sound
|
* Stop the sound
|
||||||
|
* @throws SoundException Thrown if the sound clip is null
|
||||||
*/
|
*/
|
||||||
public void stop() throws SoundException {
|
public void stop() throws SoundException {
|
||||||
if (sound == null) {
|
if (sound == null) {
|
||||||
@ -116,6 +119,7 @@ public class Sound implements Constantes {
|
|||||||
* Set the volume of the sound
|
* Set the volume of the sound
|
||||||
*
|
*
|
||||||
* @param volume Volume between 0f and 1f
|
* @param volume Volume between 0f and 1f
|
||||||
|
* @throws SoundException Thrown if the sound clip is null or the volume is out of range
|
||||||
*/
|
*/
|
||||||
public void setVolume(float volume) throws SoundException {
|
public void setVolume(float volume) throws SoundException {
|
||||||
if (sound == null) {
|
if (sound == null) {
|
||||||
|
@ -148,8 +148,9 @@ public class Animation implements Cloneable, Constantes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an image to the sprite
|
* Add an image to the animation
|
||||||
*
|
*
|
||||||
|
* @param direction The direction to add the image to
|
||||||
* @param path The path to the sprite e.g. res/player/image.png
|
* @param path The path to the sprite e.g. res/player/image.png
|
||||||
*/
|
*/
|
||||||
public void addImage(Direction direction, String path) {
|
public void addImage(Direction direction, String path) {
|
||||||
@ -164,14 +165,21 @@ public class Animation implements Cloneable, Constantes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an image to the sprite
|
* Add an image to the animation
|
||||||
*
|
*
|
||||||
|
* @param direction The direction to add the image to
|
||||||
* @param bufferedImage The path to the sprite e.g. res/player/image.png
|
* @param bufferedImage The path to the sprite e.g. res/player/image.png
|
||||||
*/
|
*/
|
||||||
public void addImage(Direction direction, BufferedImage bufferedImage) {
|
public void addImage(Direction direction, BufferedImage bufferedImage) {
|
||||||
addImageToList(direction, bufferedImage);
|
addImageToList(direction, bufferedImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add an image to the list of images
|
||||||
|
*
|
||||||
|
* @param direction The direction to add the image to
|
||||||
|
* @param bufferedImage The image to add
|
||||||
|
*/
|
||||||
private void addImageToList(Direction direction, BufferedImage bufferedImage) {
|
private void addImageToList(Direction direction, BufferedImage bufferedImage) {
|
||||||
calculateXOffset(bufferedImage.getWidth());
|
calculateXOffset(bufferedImage.getWidth());
|
||||||
calculateYOffset(bufferedImage.getHeight());
|
calculateYOffset(bufferedImage.getHeight());
|
||||||
|
@ -36,6 +36,8 @@ public class Sheet implements Constantes {
|
|||||||
* Initialize the texture collection
|
* Initialize the texture collection
|
||||||
*
|
*
|
||||||
* @param path The path to the image
|
* @param path The path to the image
|
||||||
|
* @param height The height of the textures in the image
|
||||||
|
* @param width The width of the textures in the image
|
||||||
*/
|
*/
|
||||||
public Sheet(String path, int height, int width) {
|
public Sheet(String path, int height, int width) {
|
||||||
images = new ArrayList<>();
|
images = new ArrayList<>();
|
||||||
@ -62,6 +64,7 @@ public class Sheet implements Constantes {
|
|||||||
* Returns the selected texture
|
* Returns the selected texture
|
||||||
*
|
*
|
||||||
* @return Returns the current texture
|
* @return Returns the current texture
|
||||||
|
* @param textureNumber The texture to get from the collection
|
||||||
* @throws SheetException Thrown when there are no images in the texture collection
|
* @throws SheetException Thrown when there are no images in the texture collection
|
||||||
*/
|
*/
|
||||||
public BufferedImage getTexture(int textureNumber) throws SheetException {
|
public BufferedImage getTexture(int textureNumber) throws SheetException {
|
||||||
|
Loading…
Reference in New Issue
Block a user