Class RageUpgrade
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.rendering.RenderComponent
com.csse3200.game.ui.UIComponent
com.csse3200.game.components.upgrades.RageUpgrade
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,Upgrade
,Renderable
,Comparable<Renderable>
Manages the Rage Upgrade UI component, handling activation, deactivation,
visual updates, and related sound effects.
When in rage mode, stations operate twice as fast
-
Field Summary
FieldsModifier and TypeFieldDescriptioncom.badlogic.gdx.scenes.scene2d.ui.Table
com.badlogic.gdx.scenes.scene2d.ui.ProgressBar
Fields inherited from class com.csse3200.game.ui.UIComponent
skin, stage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
Activate the upgrade, this will be called once the random upgrade is generatedvoid
Activates Rage mode by triggering the event, playing activation sound, displaying the overlay, and initializing the rage timer.void
create()
Called when the entity is created and registered.void
Deactivate the activated upgrade once it reaches time limitvoid
Deactivates Rage mode by triggering related events, playing power down sound, hiding the overlay, and initiating the rage meter refill process.protected void
draw
(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draw the renderable.float
float
boolean
boolean
boolean
void
setStage
(com.badlogic.gdx.scenes.scene2d.Stage mock) void
update()
Updates the RageUpgrade component each frame, managing the rage timer and the refill process based on the current state.Methods inherited from class com.csse3200.game.ui.UIComponent
getLayer, getZIndex
Methods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, dispose, render
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.csse3200.game.rendering.Renderable
render
-
Field Details
-
layout
public com.badlogic.gdx.scenes.scene2d.ui.Table layout -
rageMeter
public com.badlogic.gdx.scenes.scene2d.ui.ProgressBar rageMeter
-
-
Constructor Details
-
RageUpgrade
public RageUpgrade()
-
-
Method Details
-
create
public void create()Description copied from class:Component
Called when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished.- Overrides:
create
in classUIComponent
-
activate
public void activate()Description copied from interface:Upgrade
Activate the upgrade, this will be called once the random upgrade is generated -
activateRageMode
public void activateRageMode()Activates Rage mode by triggering the event, playing activation sound, displaying the overlay, and initializing the rage timer. -
deactivate
public void deactivate()Description copied from interface:Upgrade
Deactivate the activated upgrade once it reaches time limit- Specified by:
deactivate
in interfaceUpgrade
-
deactivateRageMode
public void deactivateRageMode()Deactivates Rage mode by triggering related events, playing power down sound, hiding the overlay, and initiating the rage meter refill process. -
update
public void update()Updates the RageUpgrade component each frame, managing the rage timer and the refill process based on the current state. -
draw
protected void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Description copied from class:RenderComponent
Draw the renderable. Should be called only by the renderer, not manually.- Specified by:
draw
in classRenderComponent
- Parameters:
batch
- Batch to render to.
-
setStage
public void setStage(com.badlogic.gdx.scenes.scene2d.Stage mock) - Specified by:
setStage
in interfaceRenderable
-
isOverlayVisible
public boolean isOverlayVisible() -
isRageFilling
public boolean isRageFilling() -
isRageActive
public boolean isRageActive() -
getRageFillTime
public float getRageFillTime() -
getRageFillTimeRemaining
public float getRageFillTimeRemaining()
-