Package cl.cromer.azaraka.object
Class Chest
- java.lang.Object
-
- cl.cromer.azaraka.object.Object
-
- cl.cromer.azaraka.object.Chest
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Chest.State
The possible states of the chest-
Nested classes/interfaces inherited from interface cl.cromer.azaraka.Constants
Constants.AIHeuristic, Constants.LogLevel, Constants.PlayerAIType
-
-
Field Summary
-
Fields inherited from interface cl.cromer.azaraka.Constants
AI_HEURISTIC, APPEND_LOGS, CELL_PIXELS, CHESTS, ENEMIES, ENEMY_AI, EXPORT_SCENE, FONT, FONT_SIZE, GENERATE_SCENE, GLOBAL_LOG, HORIZONTAL_CELLS, LOG_TO_FILE, OBSTACLES, PLAYER_AI, PRETTY_JSON, TITLE, VERTICAL_CELLS, VOLUME
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkPosition(int x, int y)
Check what position the chest is located atGem
getGem()
Get the gem from the chestChest.State
getState()
Get the state of the chestvoid
run()
This method is run when the thread startsvoid
setGem(Gem gem)
Put a gem in the chestvoid
setSound(Sound sound)
Set the chest open soundvoid
setState(Chest.State state)
Sets the state of the chest-
Methods inherited from class cl.cromer.azaraka.object.Object
changeDirection, drawAnimation, getActive, getAnimation, getCell, getLogger, getScene, getX, getY, loadCharacter, moveDown, moveLeft, moveRight, moveUp, setActive, setAnimation, setCell, setLogger, setUseOffset, setXScale, setYScale
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cl.cromer.azaraka.Constants
getLogger, initializeLogger, random
-
-
-
-
Method Detail
-
getState
public Chest.State getState()
Get the state of the chest- Returns:
- Returns the current state
-
setState
public void setState(Chest.State state)
Sets the state of the chest- Parameters:
state
- The new state of the chest
-
getGem
public Gem getGem()
Get the gem from the chest- Returns:
- The gem in the chest
-
setGem
public void setGem(Gem gem)
Put a gem in the chest- Parameters:
gem
- The gem
-
setSound
public void setSound(Sound sound)
Set the chest open sound- Parameters:
sound
- The sound to use
-
run
public void run()
This method is run when the thread starts
-
checkPosition
public boolean checkPosition(int x, int y)
Check what position the chest is located at- Parameters:
x
- The x position to comparey
- The y position to compare- Returns:
- Returns true if it is the same position or false otherwise
-
-