public abstract class GameLevel
extends java.lang.Object
implements com.badlogic.gdx.Screen
| Modifier and Type | Field and Description |
|---|---|
protected int |
currentTask
The id of the task that is in progress
|
protected Thyme |
game
The game that this is running in
|
protected int |
points
the number of points earned in the round
|
protected com.badlogic.gdx.scenes.scene2d.Stage |
stage
The stage that has all the data for the interface
|
protected java.util.List<Task> |
tasks
The tasks that need to be completed
|
protected TrackerWindow |
tracker
The single tracker window instance
|
protected java.util.Queue<com.badlogic.gdx.scenes.scene2d.Actor> |
windows
A queue of all windows that should be closed on each task
|
| Constructor and Description |
|---|
GameLevel(Thyme game)
Initiates the class with the game.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addToQueue(com.badlogic.gdx.scenes.scene2d.Actor a)
Adds an actor to the queue of windows to be closed.
|
protected int |
calcScore()
Calculates the score once this level is done.
|
void |
dispose()
Called when this screen should release all resources.
|
Task |
getActiveTask()
Gets the active task.
|
int |
getCurrentTask()
Gets the current task position.
|
Thyme |
getGame()
Gets the game of the class.
|
int |
getNumberOfTasks()
Gets the number of tasks.
|
com.badlogic.gdx.scenes.scene2d.Stage |
getStage()
Gets the stage of the window.
|
void |
hide()
Called when this screen is no longer the current screen for a
Game. |
void |
pause() |
void |
render(float delta)
Called when the screen should render itself.
|
void |
resize(int width,
int height) |
void |
resume() |
void |
show()
Called when this screen becomes the current screen for a
Game. |
boolean |
submit(java.lang.String[] givenAnswers)
Submits a set of answers to the current task, increments the current task
if necessary, and updates windows.
|
protected Thyme game
protected com.badlogic.gdx.scenes.scene2d.Stage stage
protected java.util.List<Task> tasks
protected int currentTask
protected java.util.Queue<com.badlogic.gdx.scenes.scene2d.Actor> windows
protected TrackerWindow tracker
protected int points
public GameLevel(Thyme game)
game - the main game objectpublic void show()
Game.show in interface com.badlogic.gdx.Screenpublic void render(float delta)
render in interface com.badlogic.gdx.Screendelta - The time in seconds since the last render.public void resize(int width,
int height)
resize in interface com.badlogic.gdx.Screenwidth - height - ApplicationListener.resize(int, int)public void pause()
pause in interface com.badlogic.gdx.ScreenApplicationListener.pause()public void resume()
resume in interface com.badlogic.gdx.ScreenApplicationListener.resume()public void hide()
Game.hide in interface com.badlogic.gdx.Screenpublic void dispose()
dispose in interface com.badlogic.gdx.Screenpublic Task getActiveTask()
public Thyme getGame()
public com.badlogic.gdx.scenes.scene2d.Stage getStage()
public void addToQueue(com.badlogic.gdx.scenes.scene2d.Actor a)
a - The window that should be cloased at the end of a
submission.public boolean submit(java.lang.String[] givenAnswers)
givenAnswers - The given answers.public int getCurrentTask()
public int getNumberOfTasks()
protected int calcScore()