フロントエンドプレイアブル
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

20
test_api_v2.rb Normal file
View File

@@ -0,0 +1,20 @@
client = GameApiClient.new
turn1 = Turn.find_by(number: 1)
if turn1
puts "Testing with Turn 1 (ID: #{turn1.id})"
# 1. 現状の渡し方 (Double Nesting?):
puts "Test 1: Passing whole game_state hash"
res1 = client.api_calculate_process(turn1.game_state, turn1.orders || {})
puts "Response 1 Keys: #{res1&.keys}"
puts "Response 1 Inner Class: #{res1['game_state'].class}" if res1
# 2. 内部データのみを渡す場合:
puts "\nTest 2: Passing inner game_state data"
inner_state = turn1.game_state['game_state']
res2 = client.api_calculate_process(inner_state, turn1.orders || {})
puts "Response 2 Keys: #{res2&.keys}"
puts "Response 2 Inner Class: #{res2['game_state'].class}" if res2
else
puts "Turn 1 not found."
end