{"action":"opened","issue":{"url":"https://api.github.com/repos/CAU-Kiel-Tech-Inf/socha-client-ruby/issues/15","repository_url":"https://api.github.com/repos/CAU-Kiel-Tech-Inf/socha-client-ruby","labels_url":"https://api.github.com/repos/CAU-Kiel-Tech-Inf/socha-client-ruby/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/CAU-Kiel-Tech-Inf/socha-client-ruby/issues/15/comments","events_url":"https://api.github.com/repos/CAU-Kiel-Tech-Inf/socha-client-ruby/issues/15/events","html_url":"https://github.com/CAU-Kiel-Tech-Inf/socha-client-ruby/issues/15","id":391945109,"node_id":"MDU6SXNzdWUzOTE5NDUxMDk=","number":15,"title":"noch mehr Fehler in Move#perform!(gamestate) ⇒ Object ","user":{"login":"kwollw","id":6341023,"node_id":"MDQ6VXNlcjYzNDEwMjM=","avatar_url":"https://avatars2.githubusercontent.com/u/6341023?v=4","gravatar_id":"","url":"https://api.github.com/users/kwollw","html_url":"https://github.com/kwollw","followers_url":"https://api.github.com/users/kwollw/followers","following_url":"https://api.github.com/users/kwollw/following{/other_user}","gists_url":"https://api.github.com/users/kwollw/gists{/gist_id}","starred_url":"https://api.github.com/users/kwollw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwollw/subscriptions","organizations_url":"https://api.github.com/users/kwollw/orgs","repos_url":"https://api.github.com/users/kwollw/repos","events_url":"https://api.github.com/users/kwollw/events{/privacy}","received_events_url":"https://api.github.com/users/kwollw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-18T00:21:33Z","updated_at":"2018-12-18T00:21:33Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Schaut man sich die Beschreibung und Implementierung dieser Methode genauer an, stellt man einen grundlegenden Fehler fest, der möglicherweise auf unzureichende Kenntnisse in Ruby zurückzuführen ist.\r\n\r\nBeabsichtigt ist nach der Kommentierung eine Mutierung des gamestate-Objektes, dass als Parameter übergeben wird. Allerdings wird in Ruby stets eine Kopie des Objektes als Argument übergeben. Also bleibt die Wirkung der Veränderung lokal.\r\n\r\nVielmehr könnte es in gamestate eine Methode perform_move!(move) geben.\r\n\r\ndef perform_move!(move) \r\nif GameRuleLogic.valid_move?(move, board, current_player_color)\r\n    type = board.field(x, y).type\r\n    board.change_field(x, y, FieldType::EMPTY)\r\n    target = GameRuleLogic.move_target(move, board)\r\n    board.change_field(target.x, target.y, type)\r\n  else\r\n    raise InvalidMoveException.new('Invalid move', move)\r\n  end\r\n  # change the state to the next turn\r\n  last_move = move\r\n  turn += 1\r\n  switch_current_player\r\nend\r\n\r\n"}}
{"actor":{"display_login":"kwollw"}}