libs.domain.score module¶
libs/domain/score.py
- class libs.domain.score.GameResult¶
Bases:
objectスコアデータ
- __init__(**kwargs)¶
- Parameters:
kwargs (Any)
- Return type:
None
- calc(**kwargs)¶
獲得ポイント計算
- Parameters:
kwargs (Any)
- Return type:
None
- comment: str | None¶
ゲームコメント
- deposit: int¶
供託
- draw_split: bool¶
同着時に順位点を山分けにするか
- has_valid_data()¶
DB更新に必要なデータを持っているかチェック
- Return type:
bool
- mode: Literal[3, 4]¶
集計モード(三人打ち/四人打ち)
- origin_point: int¶
配給原点
- rank_point: list[int]¶
順位点
- return_point: int¶
返し点
- property rpoint_sum: int¶
素点合計
- Returns:
素点合計
- Return type:
int
- rule_version: str¶
ルール識別子
- set(**kwargs)¶
データ取り込み
- Parameters:
kwargs (Any)
- Return type:
None
- source: str | None¶
データ入力元識別子
- to_list(kind='name')¶
指定データをリストで返す
- Parameters:
kind (Literal, optional) –
取得内容
name: プレイヤー名 (Default)
str: 入力された素点情報
rpoint: 素点
point: ポイント
rank: 順位
- Returns:
リスト
- Return type:
list[str | int | float]
- to_text(kind='simple')¶
データをテキストで返す
- Parameters:
kind (Literal, optional) –
表示形式
simple: 簡易情報 (Default)
detail: 詳細情報
logging: ロギング用
- Returns:
スコアデータ
- Return type:
str
- ts: str¶
タイムスタンプ
- class libs.domain.score.Score¶
Bases:
objectプレイヤー成績
Note
フィールド名の
r_プレフィックス (r_str,rpointなど) は、 GameResult.to_dict() によってp1_,p2_,p3_,p4_に置換され、 DBテーブルのカラム名 (p1_str,p2_strなど) として使用する。- __init__(name='', r_str='', rpoint=0, point=0.0, rank=0)¶
- Parameters:
name (str)
r_str (str)
rpoint (int)
point (float)
rank (int)
- Return type:
None
- has_valid_data()¶
有効なデータを持っているかチェック
- Return type:
bool
- name: str = ''¶
プレイヤー名
- point: float = 0.0¶
獲得ポイント
- r_str: str = ''¶
素点(ユーザー入力文字列/未計算)
- rank: int = 0¶
獲得順位
- rpoint: int = 0¶
素点(ユーザー入力文字列評価後)