refactor: BoardAccessible concernを導入し、ボード関連コントローラを整理、ターン表示ロジックをTurnモデルへ移動し、ボード提案表示をコントローラで処理するよう変更
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
CI / system-test (push) Has been cancelled

This commit is contained in:
2026-02-19 22:46:24 +09:00
parent bb9ec2df1d
commit e90ea88758
9 changed files with 70 additions and 136 deletions

View File

@@ -1,6 +1,19 @@
class Turn < ApplicationRecord
belongs_to :game
SEASON_MAP = { "S" => "", "F" => "", "W" => "" }.freeze
PHASE_TYPE_MAP = { "M" => "移動", "R" => "撤退", "A" => "調整" }.freeze
# フェーズコードを日本語表示に変換(例: "S1901M" → "1901年 春 (移動)"
def display_phase
return nil unless phase.present? && phase.length >= 6
year = phase[1..4]
season = SEASON_MAP[phase[0]] || ""
type = PHASE_TYPE_MAP[phase[-1]] || ""
"#{year}#{season} (#{type})"
end
# 特定の国の実行可能な命令を取得
# 例: turn.possible_orders_for("FRANCE")
def possible_orders_for(power_name)