Package com.dragonboat.game
Class ProgressBar
- java.lang.Object
- 
- com.dragonboat.game.ProgressBar
 
- 
 public class ProgressBar extends java.lang.ObjectRepresents a progress bar.
- 
- 
Field SummaryFields Modifier and Type Field Description protected Opponent[]opponentBoatscom.badlogic.gdx.graphics.TextureopponentIconprotected PlayerplayerBoatcom.badlogic.gdx.graphics.TextureplayerIconprotected floatplayerTimecom.badlogic.gdx.graphics.Texturetextureprotected floattimeSeconds
 - 
Constructor SummaryConstructors Constructor Description ProgressBar(Player player, Opponent[] opponents)Creates a progress bar that tracks the player and opponent boats progress along the course.ProgressBar(Player player, Opponent[] opponents, boolean noTexture)Creates a progress bar that tracks the player and opponent boats progress along the course.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallFinished(int finishY)Returns true if all boats have finished.com.badlogic.gdx.graphics.TexturegetOpponentIcon()Gets the opponent icon texture.com.badlogic.gdx.graphics.TexturegetPlayerIcon()Gets the player icon texture.floatgetPlayerTime()Gets the time elapsed for the player in the current race.java.lang.StringgetPlayerTimeString()Gets the time elapsed for the player in the current race and total penalty time.float[]getProgress(int finishY)Gets the progress of all boats.com.badlogic.gdx.graphics.TexturegetTexture()Gets the progress bar texture.floatgetTime()Gets the time passed for the current race.voidIncrementTimer(float timePassed)Increments the timer by the time passed.voidStartTimer()Resets the timer to zero.
 
- 
- 
- 
Field Detail- 
texturepublic transient com.badlogic.gdx.graphics.Texture texture 
 - 
playerIconpublic transient com.badlogic.gdx.graphics.Texture playerIcon 
 - 
opponentIconpublic transient com.badlogic.gdx.graphics.Texture opponentIcon 
 - 
playerBoatprotected transient Player playerBoat 
 - 
opponentBoatsprotected transient Opponent[] opponentBoats 
 - 
timeSecondsprotected float timeSeconds 
 - 
playerTimeprotected float playerTime 
 
- 
 - 
Constructor Detail- 
ProgressBarpublic ProgressBar(Player player, Opponent[] opponents) Creates a progress bar that tracks the player and opponent boats progress along the course.- Parameters:
- player- The player's boat.
- opponents- Array of opponent boats.
 
 - 
ProgressBarpublic ProgressBar(Player player, Opponent[] opponents, boolean noTexture) Creates a progress bar that tracks the player and opponent boats progress along the course.- Parameters:
- player- The player's boat.
- opponents- Array of opponent boats.
- noTexture- Debug parameter to stop LibGDX loading texture assets.
 
 
- 
 - 
Method Detail- 
StartTimerpublic void StartTimer() Resets the timer to zero.
 - 
IncrementTimerpublic void IncrementTimer(float timePassed) Increments the timer by the time passed.- Parameters:
- timePassed- The time delta from the last frame.
 
 - 
allFinishedpublic boolean allFinished(int finishY) Returns true if all boats have finished.- Parameters:
- finishY- Y-position of the finish line.
- Returns:
- Boolean representing if all boats have finished the course.
 
 - 
getProgresspublic float[] getProgress(int finishY) Gets the progress of all boats.- Parameters:
- finishY- Y-position of the finish line.
- Returns:
- Array of floats representing the percentage of the course covered by each boat. First index stores player's progress.
 
 - 
getPlayerTimepublic float getPlayerTime() Gets the time elapsed for the player in the current race.- Returns:
- Returns a float representing the player's current race time.
 
 - 
getPlayerTimeStringpublic java.lang.String getPlayerTimeString() Gets the time elapsed for the player in the current race and total penalty time.- Returns:
- String representing player time ":" penalty time.
 
 - 
getTimepublic float getTime() Gets the time passed for the current race.- Returns:
- Returns a float representing the current race time.
 
 - 
getTexturepublic com.badlogic.gdx.graphics.Texture getTexture() Gets the progress bar texture.- Returns:
- A Texture representing the sprite.
 
 - 
getPlayerIconpublic com.badlogic.gdx.graphics.Texture getPlayerIcon() Gets the player icon texture.- Returns:
- A Texture representing the sprite.
 
 - 
getOpponentIconpublic com.badlogic.gdx.graphics.Texture getOpponentIcon() Gets the opponent icon texture.- Returns:
- A Texture representing the sprite.
 
 
- 
 
-