Package com.csse3200.game.services
Class RandomComboService
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.services.RandomComboService
The RandomComboService class is responsible for managing and activating random upgrades
within the game. It selects a random upgrade from a predefined set of upgrades and triggers
corresponding events when an upgrade is activated.
Upgrades managed by this service include "Extortion", "Loan", and "Speed"..
This service utilizes the EventHandler to communicate with other game components,
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Activates the currently selected upgrade by triggering its corresponding event.boolean
dancing()
void
Retrieves the name of the currently selected upgrade based on the random choice index.Methods inherited from class com.csse3200.game.components.Component
create, dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
RandomComboService
public RandomComboService() -
RandomComboService
-
-
Method Details
-
getSelectedUpgrade
Retrieves the name of the currently selected upgrade based on the random choice index.- Returns:
- A String representing the name of the selected upgrade ("Extortion", "Loan", or "Speed").
-
activateUpgrade
public void activateUpgrade()Activates the currently selected upgrade by triggering its corresponding event. This method should be called when the player confirms the activation of the upgrade, by pressing the "YES" button in the game's UI. -
deactivateUpgrade
public void deactivateUpgrade() -
getEvents
-
dancing
public boolean dancing()
-