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.Tablecom.badlogic.gdx.scenes.scene2d.ui.ProgressBarFields inherited from class com.csse3200.game.ui.UIComponent
skin, stage -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Activate the upgrade, this will be called once the random upgrade is generatedvoidActivates Rage mode by triggering the event, playing activation sound, displaying the overlay, and initializing the rage timer.voidcreate()Called when the entity is created and registered.voidDeactivate the activated upgrade once it reaches time limitvoidDeactivates Rage mode by triggering related events, playing power down sound, hiding the overlay, and initiating the rage meter refill process.protected voiddraw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draw the renderable.floatfloatbooleanbooleanbooleanvoidsetStage(com.badlogic.gdx.scenes.scene2d.Stage mock) voidupdate()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, getZIndexMethods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, dispose, renderMethods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods 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:ComponentCalled 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:
createin classUIComponent
-
activate
public void activate()Description copied from interface:UpgradeActivate 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:UpgradeDeactivate the activated upgrade once it reaches time limit- Specified by:
deactivatein 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:RenderComponentDraw the renderable. Should be called only by the renderer, not manually.- Specified by:
drawin classRenderComponent- Parameters:
batch- Batch to render to.
-
setStage
public void setStage(com.badlogic.gdx.scenes.scene2d.Stage mock) - Specified by:
setStagein interfaceRenderable
-
isOverlayVisible
public boolean isOverlayVisible() -
isRageFilling
public boolean isRageFilling() -
isRageActive
public boolean isRageActive() -
getRageFillTime
public float getRageFillTime() -
getRageFillTimeRemaining
public float getRageFillTimeRemaining()
-