订单优化
This commit is contained in:
parent
72ad6c5893
commit
e43b18b34a
@ -145,15 +145,46 @@ func getChessDiff(ChessNum, OrderDiff, OrderN int) map[int]int {
|
|||||||
func getChessLv(Min, Max, Diff int) int {
|
func getChessLv(Min, Max, Diff int) int {
|
||||||
Start := Min
|
Start := Min
|
||||||
End := Max
|
End := Max
|
||||||
switch Diff {
|
if Max-Min >= 5 {
|
||||||
case DIFF_LOW:
|
switch Diff {
|
||||||
End = Min + (Max-Min+1)/3 - 1
|
case DIFF_LOW:
|
||||||
case DIFF_MID:
|
End = Min + (Max-Min+1)/3 - 1
|
||||||
Start = Min + (Max-Min+1)/3
|
case DIFF_MID:
|
||||||
End = Min + (Max-Min+1)/3*2 - 1
|
Start = Min + (Max-Min+1)/3
|
||||||
case DIFF_HIGH:
|
End = Min + (Max-Min+1)/3*2 - 1
|
||||||
Start = Min + (Max-Min+1)/3*2
|
case DIFF_HIGH:
|
||||||
|
Start = Min + (Max-Min+1)/3*2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if Max-Min == 2 {
|
||||||
|
Start = Max - Diff + 1
|
||||||
|
End = Start
|
||||||
|
}
|
||||||
|
if Max-Min == 3 {
|
||||||
|
switch Diff {
|
||||||
|
case DIFF_LOW:
|
||||||
|
End = Min + 1
|
||||||
|
case DIFF_MID:
|
||||||
|
Start = Min + 2
|
||||||
|
End = Min + 2
|
||||||
|
case DIFF_HIGH:
|
||||||
|
Start = Min + 3
|
||||||
|
End = Min + 3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if Max-Min == 4 {
|
||||||
|
switch Diff {
|
||||||
|
case DIFF_LOW:
|
||||||
|
End = Min + 1
|
||||||
|
case DIFF_MID:
|
||||||
|
Start = Min + 2
|
||||||
|
End = Min + 3
|
||||||
|
case DIFF_HIGH:
|
||||||
|
Start = Min + 4
|
||||||
|
End = Min + 4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Start = max(Min, Start)
|
Start = max(Min, Start)
|
||||||
End = max(Start, End)
|
End = max(Start, End)
|
||||||
End = min(Max, End)
|
End = min(Max, End)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user