refactor: define symbol counts to symbol enum instead of slot service
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
	
		
	
		
			All checks were successful
		
		
	
	
This commit is contained in:
		
					parent
					
						
							
								d2038ee160
							
						
					
				
			
			
				commit
				
					
						f71f38dfc2
					
				
			
		
					 2 changed files with 13 additions and 18 deletions
				
			
		| 
						 | 
				
			
			@ -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;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in a new issue