5
5
from mahjong .constants import AKA_DORA_LIST , CHUN , HAKU , HATSU
6
6
from mahjong .hand_calculating .divider import HandDivider
7
7
from mahjong .hand_calculating .hand import HandCalculator
8
+ from mahjong .hand_calculating .hand_config import HandConfig
8
9
from mahjong .meld import Meld
9
10
from mahjong .shanten import Shanten
10
11
from mahjong .tile import TilesConverter
@@ -285,6 +286,7 @@ def estimate_hand_value(self, win_tile, tiles=None, call_riichi=False):
285
286
:return:
286
287
"""
287
288
win_tile *= 4
289
+
288
290
# we don't need to think, that our waiting is aka dora
289
291
if win_tile in AKA_DORA_LIST :
290
292
win_tile += 1
@@ -293,17 +295,20 @@ def estimate_hand_value(self, win_tile, tiles=None, call_riichi=False):
293
295
tiles = self .player .tiles
294
296
295
297
tiles += [win_tile ]
296
- result = self .finished_hand .estimate_hand_value (tiles = tiles ,
297
- win_tile = win_tile ,
298
- is_tsumo = False ,
299
- is_riichi = call_riichi ,
300
- is_dealer = self .player .is_dealer ,
301
- melds = self .player .melds ,
302
- player_wind = self .player .player_wind ,
303
- round_wind = self .player .table .round_wind ,
304
- dora_indicators = self .player .table .dora_indicators ,
305
- has_aka_dora = self .player .table .has_aka_dora ,
306
- has_open_tanyao = self .player .table .has_open_tanyao )
298
+
299
+ config = HandConfig (
300
+ is_riichi = call_riichi ,
301
+ player_wind = self .player .player_wind ,
302
+ round_wind = self .player .table .round_wind ,
303
+ has_aka_dora = self .player .table .has_aka_dora ,
304
+ has_open_tanyao = self .player .table .has_open_tanyao
305
+ )
306
+
307
+ result = self .finished_hand .estimate_hand_value (tiles ,
308
+ win_tile ,
309
+ self .player .melds ,
310
+ self .player .table .dora_indicators ,
311
+ config )
307
312
return result
308
313
309
314
def should_call_riichi (self ):
@@ -326,7 +331,7 @@ def should_call_riichi(self):
326
331
327
332
tiles_34 = TilesConverter .to_34_array (tiles )
328
333
329
- results = self .hand_divider .divide_hand (tiles_34 , [], [] )
334
+ results = self .hand_divider .divide_hand (tiles_34 )
330
335
result = results [0 ]
331
336
332
337
count_of_pairs = len ([x for x in result if is_pair (x )])
0 commit comments