hanabiapp.models.game_info
1from datetime import datetime 2from .. import db 3from .user import User 4 5class GameInfo(db.Model): 6 """ 7 ゲームの情報をデータベースに保存するためのモデル. 8 9 Attributes: 10 id (int): ゲームの一意の識別子 11 start_time (datetime): ゲームの開始時刻 12 start_time_unix (int): Unix 時間でのゲーム開始時刻 13 end_time (datetime, optional): ゲームの終了時刻(終了していない場合は None) 14 end_time_unix (int, optional): Unix 時間でのゲーム終了時刻 15 play_time (int, optional): ゲームのプレイ時間(秒) 16 number_of_players (int): ゲームに参加したプレイヤー数 17 turn_order (str): プレイヤーのターン順を表すテキスト 18 final_score (int): ゲーム終了時の最終スコア 19 final_turns (int): ゲーム終了時の総ターン数 20 final_hint_tokens (int): ゲーム終了時のヒントトークン数 21 final_miss_tokens (int): ゲーム終了時のミストークン数 22 max_hint_tokens (int): ゲームで使用可能な最大ヒントトークン数 23 max_miss_tokens (int): ゲームで使用可能な最大ミストークン数 24 turn_time_limit (int): 1ターンの制限時間(秒) 25 seed (int): 乱数シード 26 game_end_reason (str): ゲームが終了した理由 27 deck (str): 使用されたデッキの情報(文字列形式で保存) 28 """ 29 __tablename__ = 'game_info' 30 id = db.Column(db.Integer, primary_key=True, autoincrement=True) 31 start_time = db.Column(db.DateTime, nullable=False) 32 start_time_unix = db.Column(db.Integer, nullable=False) 33 end_time = db.Column(db.DateTime, nullable=True) 34 end_time_unix = db.Column(db.Integer, nullable=True) 35 play_time = db.Column(db.Integer, nullable=True) 36 number_of_players = db.Column(db.Integer, nullable=False) 37 turn_order = db.Column(db.Text, nullable=False) 38 final_score = db.Column(db.Integer, nullable=False) 39 final_turns = db.Column(db.Integer, nullable=False) 40 final_hint_tokens = db.Column(db.Integer, nullable=False) 41 final_miss_tokens = db.Column(db.Integer, nullable=False) 42 max_hint_tokens = db.Column(db.Integer, nullable=False) 43 max_miss_tokens = db.Column(db.Integer, nullable=False) 44 turn_time_limit = db.Column(db.Integer, nullable=False) 45 seed = db.Column(db.Integer, nullable=False) 46 game_end_reason = db.Column(db.Text, nullable=False) 47 deck = db.Column(db.Text, nullable=False)
class
GameInfo(sqlalchemy.orm.decl_api._DynamicAttributesType, sqlalchemy.inspection.Inspectable[sqlalchemy.orm.mapper.Mapper[typing.Any]]):
6class GameInfo(db.Model): 7 """ 8 ゲームの情報をデータベースに保存するためのモデル. 9 10 Attributes: 11 id (int): ゲームの一意の識別子 12 start_time (datetime): ゲームの開始時刻 13 start_time_unix (int): Unix 時間でのゲーム開始時刻 14 end_time (datetime, optional): ゲームの終了時刻(終了していない場合は None) 15 end_time_unix (int, optional): Unix 時間でのゲーム終了時刻 16 play_time (int, optional): ゲームのプレイ時間(秒) 17 number_of_players (int): ゲームに参加したプレイヤー数 18 turn_order (str): プレイヤーのターン順を表すテキスト 19 final_score (int): ゲーム終了時の最終スコア 20 final_turns (int): ゲーム終了時の総ターン数 21 final_hint_tokens (int): ゲーム終了時のヒントトークン数 22 final_miss_tokens (int): ゲーム終了時のミストークン数 23 max_hint_tokens (int): ゲームで使用可能な最大ヒントトークン数 24 max_miss_tokens (int): ゲームで使用可能な最大ミストークン数 25 turn_time_limit (int): 1ターンの制限時間(秒) 26 seed (int): 乱数シード 27 game_end_reason (str): ゲームが終了した理由 28 deck (str): 使用されたデッキの情報(文字列形式で保存) 29 """ 30 __tablename__ = 'game_info' 31 id = db.Column(db.Integer, primary_key=True, autoincrement=True) 32 start_time = db.Column(db.DateTime, nullable=False) 33 start_time_unix = db.Column(db.Integer, nullable=False) 34 end_time = db.Column(db.DateTime, nullable=True) 35 end_time_unix = db.Column(db.Integer, nullable=True) 36 play_time = db.Column(db.Integer, nullable=True) 37 number_of_players = db.Column(db.Integer, nullable=False) 38 turn_order = db.Column(db.Text, nullable=False) 39 final_score = db.Column(db.Integer, nullable=False) 40 final_turns = db.Column(db.Integer, nullable=False) 41 final_hint_tokens = db.Column(db.Integer, nullable=False) 42 final_miss_tokens = db.Column(db.Integer, nullable=False) 43 max_hint_tokens = db.Column(db.Integer, nullable=False) 44 max_miss_tokens = db.Column(db.Integer, nullable=False) 45 turn_time_limit = db.Column(db.Integer, nullable=False) 46 seed = db.Column(db.Integer, nullable=False) 47 game_end_reason = db.Column(db.Text, nullable=False) 48 deck = db.Column(db.Text, nullable=False)
ゲームの情報をデータベースに保存するためのモデル.
Attributes:
- id (int): ゲームの一意の識別子
- start_time (datetime): ゲームの開始時刻
- start_time_unix (int): Unix 時間でのゲーム開始時刻
- end_time (datetime, optional): ゲームの終了時刻(終了していない場合は None)
- end_time_unix (int, optional): Unix 時間でのゲーム終了時刻
- play_time (int, optional): ゲームのプレイ時間(秒)
- number_of_players (int): ゲームに参加したプレイヤー数
- turn_order (str): プレイヤーのターン順を表すテキスト
- final_score (int): ゲーム終了時の最終スコア
- final_turns (int): ゲーム終了時の総ターン数
- final_hint_tokens (int): ゲーム終了時のヒントトークン数
- final_miss_tokens (int): ゲーム終了時のミストークン数
- max_hint_tokens (int): ゲームで使用可能な最大ヒントトークン数
- max_miss_tokens (int): ゲームで使用可能な最大ミストークン数
- turn_time_limit (int): 1ターンの制限時間(秒)
- seed (int): 乱数シード
- game_end_reason (str): ゲームが終了した理由
- deck (str): 使用されたデッキの情報(文字列形式で保存)
GameInfo(**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.