File tree 2 files changed +18
-1
lines changed
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ const (
23
23
CardsCount = 52
24
24
PerPlayerCardCount = 5
25
25
26
- Niu0 = 0
26
+ NotNiu = 0
27
27
Niu1 = 1
28
28
Niu2 = 2
29
29
Niu3 = 3
Original file line number Diff line number Diff line change @@ -114,3 +114,20 @@ func SortCards(cards []CardInfo) []CardInfo {
114
114
}
115
115
return cards
116
116
}
117
+
118
+ func BankerIsWin (bankerCards , otherCards []CardInfo ) bool {
119
+ bankerType := GetNiuType (bankerCards )
120
+ otherType := GetNiuType (bankerCards )
121
+ if bankerType != otherType {
122
+ return bankerType > otherType
123
+ }
124
+ switch bankerType {
125
+ case SmallNiu :
126
+ return true
127
+ case Bomb :
128
+ return bankerCards [2 ].CardValue > otherCards [2 ].CardValue
129
+ case GoldNiu , SilverNiu , NiuNiu , NotNiu :
130
+ return CompareCards (bankerCards [4 ], otherCards [4 ])
131
+ }
132
+ return true
133
+ }
You can’t perform that action at this time.
0 commit comments