Package level
Class LevelAPI
java.lang.Object
level.LevelAPI
Manages the level.
-
Constructor Summary
ConstructorsConstructorDescriptionLevelAPI
(com.badlogic.gdx.graphics.g2d.SpriteBatch batch, Painter painter, IGenerator generator, IOnLevelLoader onLevelLoader) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Load a new level.void
loadLevel
(int nodes, int edges, DesignLabel designLabel) Load a new level with the given configuration.void
setGenerator
(IGenerator generator) Set the level generatorvoid
Sets the current level to the given level and calls onLevelLoad().void
update()
Draw level
-
Constructor Details
-
LevelAPI
public LevelAPI(com.badlogic.gdx.graphics.g2d.SpriteBatch batch, Painter painter, IGenerator generator, IOnLevelLoader onLevelLoader) - Parameters:
batch
- Batch on which to draw.painter
- Who draws?generator
- Level generatoronLevelLoader
- Object that implements the onLevelLoad method.
-
-
Method Details
-
loadLevel
Load a new level.- Throws:
NoSolutionException
- if no level can be loaded.
-
loadLevel
Load a new level with the given configuration.- Parameters:
nodes
- Number of rooms in the leveledges
- Number of loops in the leveldesignLabel
- design of the level- Throws:
NoSolutionException
- if no level can be loaded.
-
update
public void update()Draw level -
getCurrentLevel
-
setGenerator
Set the level generator- Parameters:
generator
- new level generator
-
setLevel
Sets the current level to the given level and calls onLevelLoad().- Parameters:
level
- The level to be set.
-