Class RandomComboService

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.services.RandomComboService

public class RandomComboService extends Component
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,
  • Constructor Details

    • RandomComboService

      public RandomComboService()
    • RandomComboService

      public RandomComboService(EventHandler eventHandler)
  • Method Details

    • getSelectedUpgrade

      public String 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

      public EventHandler getEvents()
    • dancing

      public boolean dancing()