hanabiapp.models.play_log
1from datetime import datetime 2from .. import db 3from .user import User 4 5class PlayLog(db.Model): 6 """ 7 各ターンのプレイログをデータベースに保存するためのモデル. 8 9 Attributes: 10 id (int): プレイログの一意の識別子 11 game_id (int): 関連するゲームのID(`game_info.id` への外部キー) 12 turn (int): ターン番号 13 hints (int): 残りのヒントトークン数 14 miss (int): 残りのミストークン数 15 deck_size (int): 残りのデッキの枚数 16 discard_b (str): 青の捨て札 17 discard_g (str): 緑の捨て札 18 discard_r (str): 赤の捨て札 19 discard_w (str): 白の捨て札 20 discard_y (str): 黄の捨て札 21 fireworks_b (int): 青の花火の進行状況 22 fireworks_g (int): 緑の花火の進行状況 23 fireworks_r (int): 赤の花火の進行状況 24 fireworks_w (int): 白の花火の進行状況 25 fireworks_y (int): 黄の花火の進行状況 26 hand_pid (str): 各プレイヤーの手札情報 27 hint_pid (str): ヒントを受けたプレイヤーの情報 28 current_pid (int): 現在のターンのプレイヤーID 29 turn_perform_unixtime (int): ターン実行時のUnix時間 30 turn_perform_time (datetime): ターン実行時の日時 31 think_time (int): ターンでの思考時間(秒) 32 action (str): 実行されたアクションの詳細 33 num_of_valid_actions (int): 有効なアクションの数 34 score_per_turn (int): そのターンのスコア 35 action_type (str): 実行されたアクションの種類 36 timeout (int): タイムアウトの有無(1=タイムアウト発生,0=なし) 37 """ 38 __tablename__ = 'play_log' 39 id = db.Column(db.Integer, primary_key=True, autoincrement=True) 40 game_id = db.Column(db.Integer, db.ForeignKey('game_info.id'), nullable=False) 41 turn = db.Column(db.Integer, nullable=False) 42 hints = db.Column(db.Integer, nullable=False) 43 miss = db.Column(db.Integer, nullable=False) 44 deck_size = db.Column(db.Integer, nullable=False) 45 discard_b = db.Column(db.Text, nullable=False) 46 discard_g = db.Column(db.Text, nullable=False) 47 discard_r = db.Column(db.Text, nullable=False) 48 discard_w = db.Column(db.Text, nullable=False) 49 discard_y = db.Column(db.Text, nullable=False) 50 fireworks_b = db.Column(db.Integer, nullable=False) 51 fireworks_g = db.Column(db.Integer, nullable=False) 52 fireworks_r = db.Column(db.Integer, nullable=False) 53 fireworks_w = db.Column(db.Integer, nullable=False) 54 fireworks_y = db.Column(db.Integer, nullable=False) 55 hand_pid = db.Column(db.Text, nullable=False) 56 hint_pid = db.Column(db.Text, nullable=False) 57 current_pid = db.Column(db.Integer, nullable=False) 58 turn_perform_unixtime = db.Column(db.Integer, nullable=False) 59 turn_perform_time = db.Column(db.DateTime, nullable=False) 60 think_time = db.Column(db.Integer, nullable=False) 61 action = db.Column(db.Text, nullable=False) 62 num_of_valid_actions = db.Column(db.Integer, nullable=False) 63 score_per_turn = db.Column(db.Integer, nullable=False) 64 action_type = db.Column(db.Text, nullable=False) 65 timeout = db.Column(db.Integer, nullable=False)
class
PlayLog(sqlalchemy.orm.decl_api._DynamicAttributesType, sqlalchemy.inspection.Inspectable[sqlalchemy.orm.mapper.Mapper[typing.Any]]):
6class PlayLog(db.Model): 7 """ 8 各ターンのプレイログをデータベースに保存するためのモデル. 9 10 Attributes: 11 id (int): プレイログの一意の識別子 12 game_id (int): 関連するゲームのID(`game_info.id` への外部キー) 13 turn (int): ターン番号 14 hints (int): 残りのヒントトークン数 15 miss (int): 残りのミストークン数 16 deck_size (int): 残りのデッキの枚数 17 discard_b (str): 青の捨て札 18 discard_g (str): 緑の捨て札 19 discard_r (str): 赤の捨て札 20 discard_w (str): 白の捨て札 21 discard_y (str): 黄の捨て札 22 fireworks_b (int): 青の花火の進行状況 23 fireworks_g (int): 緑の花火の進行状況 24 fireworks_r (int): 赤の花火の進行状況 25 fireworks_w (int): 白の花火の進行状況 26 fireworks_y (int): 黄の花火の進行状況 27 hand_pid (str): 各プレイヤーの手札情報 28 hint_pid (str): ヒントを受けたプレイヤーの情報 29 current_pid (int): 現在のターンのプレイヤーID 30 turn_perform_unixtime (int): ターン実行時のUnix時間 31 turn_perform_time (datetime): ターン実行時の日時 32 think_time (int): ターンでの思考時間(秒) 33 action (str): 実行されたアクションの詳細 34 num_of_valid_actions (int): 有効なアクションの数 35 score_per_turn (int): そのターンのスコア 36 action_type (str): 実行されたアクションの種類 37 timeout (int): タイムアウトの有無(1=タイムアウト発生,0=なし) 38 """ 39 __tablename__ = 'play_log' 40 id = db.Column(db.Integer, primary_key=True, autoincrement=True) 41 game_id = db.Column(db.Integer, db.ForeignKey('game_info.id'), nullable=False) 42 turn = db.Column(db.Integer, nullable=False) 43 hints = db.Column(db.Integer, nullable=False) 44 miss = db.Column(db.Integer, nullable=False) 45 deck_size = db.Column(db.Integer, nullable=False) 46 discard_b = db.Column(db.Text, nullable=False) 47 discard_g = db.Column(db.Text, nullable=False) 48 discard_r = db.Column(db.Text, nullable=False) 49 discard_w = db.Column(db.Text, nullable=False) 50 discard_y = db.Column(db.Text, nullable=False) 51 fireworks_b = db.Column(db.Integer, nullable=False) 52 fireworks_g = db.Column(db.Integer, nullable=False) 53 fireworks_r = db.Column(db.Integer, nullable=False) 54 fireworks_w = db.Column(db.Integer, nullable=False) 55 fireworks_y = db.Column(db.Integer, nullable=False) 56 hand_pid = db.Column(db.Text, nullable=False) 57 hint_pid = db.Column(db.Text, nullable=False) 58 current_pid = db.Column(db.Integer, nullable=False) 59 turn_perform_unixtime = db.Column(db.Integer, nullable=False) 60 turn_perform_time = db.Column(db.DateTime, nullable=False) 61 think_time = db.Column(db.Integer, nullable=False) 62 action = db.Column(db.Text, nullable=False) 63 num_of_valid_actions = db.Column(db.Integer, nullable=False) 64 score_per_turn = db.Column(db.Integer, nullable=False) 65 action_type = db.Column(db.Text, nullable=False) 66 timeout = db.Column(db.Integer, nullable=False)
各ターンのプレイログをデータベースに保存するためのモデル.
Attributes:
- id (int): プレイログの一意の識別子
- game_id (int): 関連するゲームのID(
game_info.idへの外部キー) - turn (int): ターン番号
- hints (int): 残りのヒントトークン数
- miss (int): 残りのミストークン数
- deck_size (int): 残りのデッキの枚数
- discard_b (str): 青の捨て札
- discard_g (str): 緑の捨て札
- discard_r (str): 赤の捨て札
- discard_w (str): 白の捨て札
- discard_y (str): 黄の捨て札
- fireworks_b (int): 青の花火の進行状況
- fireworks_g (int): 緑の花火の進行状況
- fireworks_r (int): 赤の花火の進行状況
- fireworks_w (int): 白の花火の進行状況
- fireworks_y (int): 黄の花火の進行状況
- hand_pid (str): 各プレイヤーの手札情報
- hint_pid (str): ヒントを受けたプレイヤーの情報
- current_pid (int): 現在のターンのプレイヤーID
- turn_perform_unixtime (int): ターン実行時のUnix時間
- turn_perform_time (datetime): ターン実行時の日時
- think_time (int): ターンでの思考時間(秒)
- action (str): 実行されたアクションの詳細
- num_of_valid_actions (int): 有効なアクションの数
- score_per_turn (int): そのターンのスコア
- action_type (str): 実行されたアクションの種類
- timeout (int): タイムアウトの有無(1=タイムアウト発生,0=なし)
PlayLog(**kwargs)
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and
values in kwargs.
Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships.