示例#1
0
    def __init__(self, players, connector=None, configuration=None, score_calc=None):
        self.player_profiles = [player.get_game_info() for player in players]
        self.player_number = len(self.player_profiles)
        self.start_player = -1

        self.tiles = Tiles.read_hand(config.allTileString)
        self.fuuro_lists = [[0] * 20] * 4
        self.dora_list = []
        self.agari_tile = Tiles.Tile()
        self.tumo = False
        self.kyoutaku_bon = 0                                   # number of tensu-bou on table

        self.bakaze = 0                                         # 0 -> Tou-huu ni settee s***e
        self.gyouku = 0                                         # 3 -> Han Cyan all last
        self.honba = 0
        self.turn = 0                                           # curr_player = turn % 4

        self.random_method = random.shuffle                     # default method
        self.configuration = configuration                      # configuration from utility
        self.score_calc = mjscore.MJScore()

        self.client_connector = connector
示例#2
0
    hand2 = players[1].get_game_info().get_hand()
    hand3 = players[2].get_game_info().get_hand()
    hand4 = players[3].get_game_info().get_hand()
    hands = [hand1, hand2, hand3, hand4]

    controller = GameController(players, None, None, None)

    controller.initialization()

    if False:
        for player in players:
            hand = ""
            for item in player.get_game_info().get_hand().tiles:
                hand += item.get_value()

            Tiles.print_hand(Tiles.read_hand(hand))
            print

    if True:
        result = controller.get_score(1)

        print result


if True:
    result = ''

    player1 = PlayerInfo.Player()
    player2 = PlayerInfo.Player()
    player3 = PlayerInfo.Player()
    player4 = PlayerInfo.Player()