55from mahjong .constants import AKA_DORA_LIST , CHUN , HAKU , HATSU
66from mahjong .hand_calculating .divider import HandDivider
77from mahjong .hand_calculating .hand import HandCalculator
8+ from mahjong .hand_calculating .hand_config import HandConfig
89from mahjong .meld import Meld
910from mahjong .shanten import Shanten
1011from mahjong .tile import TilesConverter
@@ -285,6 +286,7 @@ def estimate_hand_value(self, win_tile, tiles=None, call_riichi=False):
285286 :return:
286287 """
287288 win_tile *= 4
289+
288290 # we don't need to think, that our waiting is aka dora
289291 if win_tile in AKA_DORA_LIST :
290292 win_tile += 1
@@ -293,17 +295,20 @@ def estimate_hand_value(self, win_tile, tiles=None, call_riichi=False):
293295 tiles = self .player .tiles
294296
295297 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 )
307312 return result
308313
309314 def should_call_riichi (self ):
@@ -326,7 +331,7 @@ def should_call_riichi(self):
326331
327332 tiles_34 = TilesConverter .to_34_array (tiles )
328333
329- results = self .hand_divider .divide_hand (tiles_34 , [], [] )
334+ results = self .hand_divider .divide_hand (tiles_34 )
330335 result = results [0 ]
331336
332337 count_of_pairs = len ([x for x in result if is_pair (x )])
0 commit comments