フロントエンドプレイアブル
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-15 14:57:17 +09:00
commit f25fd6f802
198 changed files with 10342 additions and 0 deletions

36
check_units.rb Normal file
View File

@@ -0,0 +1,36 @@
def get_units_from_gs(gs)
return {} if gs.nil?
# powers[power_name]['units'] に入っていると想定
units = {}
if gs['powers'].is_a?(Hash)
gs['powers'].each do |power, data|
units[power] = data['units']
end
end
units
end
t1 = Turn.find_by(number: 1)
t2 = Turn.find_by(number: 2)
puts "--- Turn 1 (SPRING 1901 MOVEMENT) Units ---"
u1 = get_units_from_gs(t1&.game_state)
puts u1.inspect
puts "\n--- Turn 2 (FALL 1901 MOVEMENT) Units ---"
if t2
u2 = get_units_from_gs(t2.game_state)
puts u2.inspect
puts "\nDifference detected?"
if u1 == u2
puts "NO CHANGE in unit positions!"
else
puts "Unit positions HAVE CHANGED."
end
puts "\nTurn 1 Orders stored in DB:"
puts t1.orders.inspect
else
puts "Turn 2 not found."
end