> For the complete documentation index, see [llms.txt](https://kashiwara.gitbook.io/rubydesurufurusukuratchibe/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kashiwara.gitbook.io/rubydesurufurusukuratchibe/zui-zhong-zhang-ji-neng-zhui-jia/gamemanagerclassno.md).

# GameManagerClassの修正

### 改修したPlayerクラスを適用する

board\_stateをgets\_piece\_locationメソッドで受け取れるようにしたので、それに関連する箇所を修正しましょう。

<pre class="language-ruby"><code class="lang-ruby"># 説明: プレイヤーがコマを配置する場所を取得してターンを進める
# 引数: なし
# 戻り値: なし
<strong>def player_turn
</strong>  row, col = @current_player.gets_piece_location(@board.board_state)
  @board.update(row, col, @current_player.piece)
rescue TicTacToeInputError => e
  puts ""
  puts e.message
  puts ""
  player_turn
rescue ComError => e
  puts ""
  puts e.message
  puts ""
 rescue e
   raise e
 end
</code></pre>

### テストの修正

今の状態だとgame\_manager\_test.rbは落ちるので修正します。

{% hint style="info" %}
**課題コーナー**

game\_manager\_test.rbを修正して通過させる
{% endhint %}

参考コードは以下のURLから参照してください。

{% embed url="<https://github.com/Kashiwara0205/ruby-tic-tac-toe/blob/master/ch5/code/test/game_manager_test.rb>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://kashiwara.gitbook.io/rubydesurufurusukuratchibe/zui-zhong-zhang-ji-neng-zhui-jia/gamemanagerclassno.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
