Class SlotEngine.SlotConfig
java.lang.Object
com.csse3200.game.components.slot.SlotEngine.SlotConfig
- Enclosing class:
SlotEngine
Configuration for SlotEngine. Includes overall trigger probability and event weights.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
void
setTriggerProbability
(double p) void
setWeight
(SlotEngine.Effect effect, int weight) Set a single weight (allows 0 to disable an effect).void
setWeights
(Map<SlotEngine.Effect, Integer> newWeights) Bulk set 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
- Returns:
- Weight map for events.
-
setWeight
Set a single weight (allows 0 to disable an effect). -
setWeights
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).
-