Compare commits

...

2 commits

Author SHA1 Message Date
eb7d28e290
Merge pull request 'refactor: define symbol counts to symbol enum instead of slot service' (!148) from refactor-symbol into main
All checks were successful
Release / Release (push) Successful in 1m0s
Release / Build Frontend Image (push) Successful in 26s
Release / Build Backend Image (push) Successful in 57s
Reviewed-on: #148
Reviewed-by: Constantin Simonis <constantin@simonis.lol>
2025-04-24 13:56:32 +00:00
Phan Huy Tran
f71f38dfc2 refactor: define symbol counts to symbol enum instead of slot service
All checks were successful
CI / Get Changed Files (pull_request) Successful in 6s
CI / eslint (pull_request) Has been skipped
CI / prettier (pull_request) Has been skipped
CI / test-build (pull_request) Has been skipped
CI / Checkstyle Main (pull_request) Successful in 37s
2025-04-24 15:50:50 +02:00
2 changed files with 13 additions and 18 deletions

View file

@ -16,13 +16,6 @@ import static de.szut.casino.slots.Symbol.*;
public class SlotService {
private final int REEL_LENGTH = 32;
// 98% RTP
private final int SEVEN_COUNT = 1;
private final int BAR_COUNT = 4;
private final int BELL_COUNT = 7;
private final int CHERRY_COUNT = 10;
private final int BLANK_COUNT = 10;
private final List<Symbol> firstReel;
private final List<Symbol> secondReel;
private final List<Symbol> thirdReel;
@ -109,11 +102,11 @@ public class SlotService {
private List<Symbol> createReelStrip() {
List<Symbol> reelStrip = new ArrayList<>(REEL_LENGTH);
addSymbolsToStrip(reelStrip, CHERRY, CHERRY_COUNT);
addSymbolsToStrip(reelStrip, BELL, BELL_COUNT);
addSymbolsToStrip(reelStrip, BAR, BAR_COUNT);
addSymbolsToStrip(reelStrip, SEVEN, SEVEN_COUNT);
addSymbolsToStrip(reelStrip, BLANK, BLANK_COUNT);
addSymbolsToStrip(reelStrip, CHERRY, CHERRY.getCountPerStrip());
addSymbolsToStrip(reelStrip, BELL, BELL.getCountPerStrip());
addSymbolsToStrip(reelStrip, BAR, BAR.getCountPerStrip());
addSymbolsToStrip(reelStrip, SEVEN, SEVEN.getCountPerStrip());
addSymbolsToStrip(reelStrip, BLANK, BLANK.getCountPerStrip());
return reelStrip;
}

View file

@ -6,17 +6,19 @@ import java.math.BigDecimal;
@Getter
public enum Symbol {
SEVEN("seven", new BigDecimal("1000")),
BAR("bar", new BigDecimal("85")),
BELL("bell", new BigDecimal("40")),
CHERRY("cherry", new BigDecimal("10")),
BLANK("blank", new BigDecimal("0"));
SEVEN("seven", new BigDecimal("1000"), 1),
BAR("bar", new BigDecimal("85"), 4),
BELL("bell", new BigDecimal("40"), 7),
CHERRY("cherry", new BigDecimal("10"), 10),
BLANK("blank", new BigDecimal("0"), 10);
private final String displayName;
private final BigDecimal payoutMultiplier;
private final int countPerStrip;
Symbol(String displayName, BigDecimal payoutMultiplier) {
Symbol(String displayName, BigDecimal payoutMultiplier, int count) {
this.displayName = displayName;
this.payoutMultiplier = payoutMultiplier;
this.countPerStrip = count;
}
}