SlotUnit.java
1.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.neotel.webbox.capacitynew.box;
import com.neotel.webbox.capacitynew.bean.ReelData;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class SlotUnit {
public SlotUnit(ReelData reelData, int reelCount) {
this.reelData = reelData;
this.reelCount = reelCount;
}
private ReelData reelData; //料盘数据
private int reelCount; //料盘数量
public int getSlotHeight(){
int count = reelCount;
if(reelData.is7Reel()){
//7寸盘,一行摆2个
count = reelCount / 2;
if(count < reelData.getMinUnit()){
//小于最小单元,需要进行补充
count = reelData.getMinUnit();
reelCount = count * 2;
}else{
if(reelCount % 2 != 0){
count = count + 1;
reelCount = reelCount + 1;
}
}
}
int reelSlotHeight = reelData.getReelSlotHeight();
return count * reelSlotHeight;
}
}