Ejemplo n.º 1
0
    def get_results(
            self,
            worksheet: gspread.models.Worksheet) -> (int, int, float, str):
        """
        プレイヤの戦績を取得
        @param worksheet: ワークシートオブジェクト
        @return num_game: 試合数
        @return num_win: 勝利数
        @return winning_rate: 勝率
        @return average: 平均スコア
        """
        num_game = int(worksheet.cell(self.row, 2).value)
        num_win = int(worksheet.cell(self.row, 3).value)
        winning_rate = None
        average = worksheet.cell(self.row, 11).value

        if num_game > 0:
            winning_rate = num_win / num_game

        self.num_game = num_game
        self.num_win = num_win
        self.winning_rate = winning_rate
        self.average = average

        return num_game, num_win, winning_rate, average
Ejemplo n.º 2
0
 def get_name(self, worksheet: gspread.models.Worksheet) -> str:
     """
     プレイヤ名を取得
     @param worksheet: ワークシートオブジェクト
     @return name: プレイヤ名
     """
     name = worksheet.cell(1, self.column).value
     self.name = name
     return name
Ejemplo n.º 3
0
    def get_results(self,
                    worksheet: gspread.models.Worksheet) -> (int, int, float):
        """
        プレイヤの戦績を取得
        @param worksheet: ワークシートオブジェクト
        @return num_game: 試合数
        @return num_win: 勝利数
        @return winning_rate: 勝率
        """
        num_game = int(worksheet.cell(2, self.column).value)
        num_win = int(worksheet.cell(6, self.column).value)
        winning_rate = None

        if num_game > 0:
            winning_rate = num_win / num_game

        self.num_game = num_game
        self.num_win = num_win
        self.winning_rate = winning_rate

        return num_game, num_win, winning_rate