def call_draw_card(self, call_params={}): from game.mahjong.models.systemact.system_act_manager import SystemActManager seat_id = call_params.get("seat_id") card_num = call_params.get("card_num", 1) is_last = call_params.get("is_last", False) SystemActManager.get_instance(self.desk_id).system_act( act_type=SystemActType.DRAW_CARD, act_params={ "seat_id": seat_id, "card_num": card_num, "is_last": is_last })
def end_game(self): """ """ from game.mahjong.models.systemact.system_act_manager import SystemActManager return SystemActManager.get_instance(self.desk_id).system_act( act_type=SystemActType.GAME_OVER, act_params={})
def settle(self, settle_type_list=[]): """ """ from game.mahjong.models.systemact.system_act_manager import SystemActManager return SystemActManager.get_instance(self.desk_id).system_act( act_type=SystemActType.SETTLE, act_params={"type_list": settle_type_list})
def system_act(self, act_type, act_params={}): """ 调用系统操作 :param act_type: 系统操作类型 :param act_params: 不同的系统操作类型不同 :return: """ from game.mahjong.models.systemact.system_act_manager import SystemActManager return SystemActManager.get_instance(self.desk_id).system_act( act_type=act_type, act_params=act_params)
def execute_system_act(self, act_type, act_params): """ 执行系统指定的行为 :param act_type: :param act_params: :return: """ logger.debug(u"execute_system_act: %s", [act_type, act_params]) ret = SystemActManager.get_instance(self.desk_id).system_act( act_type, act_params=act_params) self.go_next_act(act_type)
def check_against(self, cur_seat_id, card_val): """ 检查其他玩家是否可以操作 :param cur_seat_id: :param card_val: :return: """ from game.mahjong.models.systemact.system_act_manager import SystemActManager return SystemActManager.get_instance(self.desk_id).system_act( act_type=SystemActType.CHECK_AGAINST, act_params={ "cur_seat_id": cur_seat_id, "card": card_val })
def draw_card(self, seat_id, card_num=1, is_last=False): """ 玩家摸牌 :param seat_id: :param card_num: :param is_last: :return: """ from game.mahjong.models.systemact.system_act_manager import SystemActManager return SystemActManager.get_instance(self.desk_id).system_act( act_type=SystemActType.DRAW_CARD, act_params={ "seat_id": seat_id, "card_num": card_num, "is_last": is_last })