Class SlotEngine.SlotConfig

java.lang.Object
com.csse3200.game.components.slot.SlotEngine.SlotConfig
Enclosing class:
SlotEngine

public static class SlotEngine.SlotConfig extends Object
Configuration for SlotEngine. Includes overall trigger probability and event weights.
  • Constructor Details

    • SlotConfig

      public SlotConfig()
  • Method Details

    • getTriggerProbability

      public double getTriggerProbability()
      Returns:
      Probability of triggering an event (0..1).
    • setTriggerProbability

      public void setTriggerProbability(double p)
      Parameters:
      p - New trigger probability (0..1).
    • getWeights

      public Map<SlotEngine.Effect,Integer> getWeights()
      Returns:
      Weight map for events.
    • setWeight

      public void setWeight(SlotEngine.Effect effect, int weight)
      Set a single weight (allows 0 to disable an effect).
    • setWeights

      public void setWeights(Map<SlotEngine.Effect,Integer> newWeights)
      Bulk set weights. Missing effects keep their previous values; negative values are rejected. Passing an empty map is allowed (but picking will fail later with an exception if all weights are non-positive).