{"action":"created","comment":{"url":"https://api.github.com/repos/dgebhard/aufgabe4/pulls/comments/31720562","id":31720562,"diff_hunk":"@@ -0,0 +1,169 @@\n+<?php\n+\n+class Game\n+{\n+\n+    /**\n+     * @var Player[]\n+     */\n+    private $players = array();\n+\n+    /**\n+     * @var int\n+     */\n+    private $rounds;\n+\n+    /**\n+     * @var int\n+     */\n+    private $sleep;\n+\n+    /**\n+     * @var Logger\n+     */\n+    private $logger;\n+\n+    /**\n+     * @var array\n+     */\n+    private $colors;\n+\n+    /**\n+     * @var Dice\n+     */\n+    private $dice;\n+\n+    /**\n+     * @var Factory\n+     */\n+    private $factory;\n+\n+    /**\n+     * @var bool\n+     */\n+    private $finished = false;\n+\n+    /**\n+     * @var Configuration\n+     */\n+    private $conf;\n+\n+    /**\n+     * @var Player|null\n+     */\n+    private $winner;\n+\n+    /**\n+     * @param Configuration $conf\n+     *\n+     * @throws Exception\n+     */\n+    function __construct(Configuration $conf)\n+    {\n+        $this->conf = $conf;\n+        $this->factory = new Factory($conf->getPath());\n+\n+        $this->rounds = 0;\n+        $this->sleep = $this->conf->getValue('sleep');\n+        $this->colors = $this->conf->getColors();\n+\n+        if ($this->conf->getValue('logfile') != \"\") {\n+            $this->logger = $this->factory->getInstance(\"FileLogger\", array($this->conf->getValue('logfile')));\n+        } else {\n+            $this->logger = $this->factory->getInstance(\"EchoLogger\");\n+        }\n+\n+    }\n+\n+    /**\n+     * @param Player $player\n+     *\n+     * @return mixed\n+     * @throws Exception\n+     */\n+    public function handOutCards($player, $colors)\n+    {\n+        $i = 0;\n+        while ($i < 5) {\n+            $colorkey = array_rand($colors, 1);\n+\n+            $card = $this->factory->getInstance('Card', array($colors[$colorkey]));\n+\n+            $player->addCard($card);\n+            unset($colors[$colorkey]);\n+\n+            $i++;\n+        }\n+\n+        return $player;\n+    }\n+\n+    public function play()\n+    {\n+        while ($this->winner == null) {\n+            foreach ($this->players as $player) {\n+                $success = false;\n+\n+\n+                $diceColor = $this->dice->roll();\n+\n+                $player->check($diceColor, $this);","path":"src/Game.php","position":110,"original_position":110,"commit_id":"33fe8259e62e086539282962619b38526e87c3dc","original_commit_id":"33fe8259e62e086539282962619b38526e87c3dc","user":{"login":"FloEberle","id":412740,"avatar_url":"https://avatars.githubusercontent.com/u/412740?v=3","gravatar_id":"","url":"https://api.github.com/users/FloEberle","html_url":"https://github.com/FloEberle","followers_url":"https://api.github.com/users/FloEberle/followers","following_url":"https://api.github.com/users/FloEberle/following{/other_user}","gists_url":"https://api.github.com/users/FloEberle/gists{/gist_id}","starred_url":"https://api.github.com/users/FloEberle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FloEberle/subscriptions","organizations_url":"https://api.github.com/users/FloEberle/orgs","repos_url":"https://api.github.com/users/FloEberle/repos","events_url":"https://api.github.com/users/FloEberle/events{/privacy}","received_events_url":"https://api.github.com/users/FloEberle/received_events","type":"User","site_admin":false},"body":"Interessiert nur den Spieler","created_at":"2015-06-04T13:43:19Z","updated_at":"2015-06-04T13:43:19Z","html_url":"https://github.com/dgebhard/aufgabe4/pull/1#discussion_r31720562","pull_request_url":"https://api.github.com/repos/dgebhard/aufgabe4/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/dgebhard/aufgabe4/pulls/comments/31720562"},"html":{"href":"https://github.com/dgebhard/aufgabe4/pull/1#discussion_r31720562"},"pull_request":{"href":"https://api.github.com/repos/dgebhard/aufgabe4/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/dgebhard/aufgabe4/pulls/1","id":36908229,"html_url":"https://github.com/dgebhard/aufgabe4/pull/1","diff_url":"https://github.com/dgebhard/aufgabe4/pull/1.diff","patch_url":"https://github.com/dgebhard/aufgabe4/pull/1.patch","issue_url":"https://api.github.com/repos/dgebhard/aufgabe4/issues/1","number":1,"state":"open","locked":false,"title":"Spiel funktioniert, erste Version","user":{"login":"dgebhard","id":12696453,"avatar_url":"https://avatars.githubusercontent.com/u/12696453?v=3","gravatar_id":"","url":"https://api.github.com/users/dgebhard","html_url":"https://github.com/dgebhard","followers_url":"https://api.github.com/users/dgebhard/followers","following_url":"https://api.github.com/users/dgebhard/following{/other_user}","gists_url":"https://api.github.com/users/dgebhard/gists{/gist_id}","starred_url":"https://api.github.com/users/dgebhard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgebhard/subscriptions","organizations_url":"https://api.github.com/users/dgebhard/orgs","repos_url":"https://api.github.com/users/dgebhard/repos","events_url":"https://api.github.com/users/dgebhard/events{/privacy}","received_events_url":"https://api.github.com/users/dgebhard/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-04T07:20:45Z","updated_at":"2015-06-04T13:43:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c0f304bcb2d82c0d6e99dde90c76c423ee60df77","assignee":{"login":"FloEberle","id":412740,"avatar_url":"https://avatars.githubusercontent.com/u/412740?v=3","gravatar_id":"","url":"https://api.github.com/users/FloEberle","html_url":"https://github.com/FloEberle","followers_url":"https://api.github.com/users/FloEberle/followers","following_url":"https://api.github.com/users/FloEberle/following{/other_user}","gists_url":"https://api.github.com/users/FloEberle/gists{/gist_id}","starred_url":"https://api.github.com/users/FloEberle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FloEberle/subscriptions","organizations_url":"https://api.github.com/users/FloEberle/orgs","repos_url":"https://api.github.com/users/FloEberle/repos","events_url":"https://api.github.com/users/FloEberle/events{/privacy}","received_events_url":"https://api.github.com/users/FloEberle/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/dgebhard/aufgabe4/pulls/1/commits","review_comments_url":"https://api.github.com/repos/dgebhard/aufgabe4/pulls/1/comments","review_comment_url":"https://api.github.com/repos/dgebhard/aufgabe4/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dgebhard/aufgabe4/issues/1/comments","statuses_url":"https://api.github.com/repos/dgebhard/aufgabe4/statuses/33fe8259e62e086539282962619b38526e87c3dc","head":{"label":"dgebhard:dev","ref":"dev","sha":"33fe8259e62e086539282962619b38526e87c3dc","user":{"login":"dgebhard","id":12696453,"avatar_url":"https://avatars.githubusercontent.com/u/12696453?v=3","gravatar_id":"","url":"https://api.github.com/users/dgebhard","html_url":"https://github.com/dgebhard","followers_url":"https://api.github.com/users/dgebhard/followers","following_url":"https://api.github.com/users/dgebhard/following{/other_user}","gists_url":"https://api.github.com/users/dgebhard/gists{/gist_id}","starred_url":"https://api.github.com/users/dgebhard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgebhard/subscriptions","organizations_url":"https://api.github.com/users/dgebhard/orgs","repos_url":"https://api.github.com/users/dgebhard/repos","events_url":"https://api.github.com/users/dgebhard/events{/privacy}","received_events_url":"https://api.github.com/users/dgebhard/received_events","type":"User","site_admin":false},"repo":{"id":36791910,"name":"aufgabe4","full_name":"dgebhard/aufgabe4","owner":{"login":"dgebhard","id":12696453,"avatar_url":"https://avatars.githubusercontent.com/u/12696453?v=3","gravatar_id":"","url":"https://api.github.com/users/dgebhard","html_url":"https://github.com/dgebhard","followers_url":"https://api.github.com/users/dgebhard/followers","following_url":"https://api.github.com/users/dgebhard/following{/other_user}","gists_url":"https://api.github.com/users/dgebhard/gists{/gist_id}","starred_url":"https://api.github.com/users/dgebhard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgebhard/subscriptions","organizations_url":"https://api.github.com/users/dgebhard/orgs","repos_url":"https://api.github.com/users/dgebhard/repos","events_url":"https://api.github.com/users/dgebhard/events{/privacy}","received_events_url":"https://api.github.com/users/dgebhard/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dgebhard/aufgabe4","description":"","fork":false,"url":"https://api.github.com/repos/dgebhard/aufgabe4","forks_url":"https://api.github.com/repos/dgebhard/aufgabe4/forks","keys_url":"https://api.github.com/repos/dgebhard/aufgabe4/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dgebhard/aufgabe4/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dgebhard/aufgabe4/teams","hooks_url":"https://api.github.com/repos/dgebhard/aufgabe4/hooks","issue_events_url":"https://api.github.com/repos/dgebhard/aufgabe4/issues/events{/number}","events_url":"https://api.github.com/repos/dgebhard/aufgabe4/events","assignees_url":"https://api.github.com/repos/dgebhard/aufgabe4/assignees{/user}","branches_url":"https://api.github.com/repos/dgebhard/aufgabe4/branches{/branch}","tags_url":"https://api.github.com/repos/dgebhard/aufgabe4/tags","blobs_url":"https://api.github.com/repos/dgebhard/aufgabe4/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dgebhard/aufgabe4/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dgebhard/aufgabe4/git/refs{/sha}","trees_url":"https://api.github.com/repos/dgebhard/aufgabe4/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dgebhard/aufgabe4/statuses/{sha}","languages_url":"https://api.github.com/repos/dgebhard/aufgabe4/languages","stargazers_url":"https://api.github.com/repos/dgebhard/aufgabe4/stargazers","contributors_url":"https://api.github.com/repos/dgebhard/aufgabe4/contributors","subscribers_url":"https://api.github.com/repos/dgebhard/aufgabe4/subscribers","subscription_url":"https://api.github.com/repos/dgebhard/aufgabe4/subscription","commits_url":"https://api.github.com/repos/dgebhard/aufgabe4/commits{/sha}","git_commits_url":"https://api.github.com/repos/dgebhard/aufgabe4/git/commits{/sha}","comments_url":"https://api.github.com/repos/dgebhard/aufgabe4/comments{/number}","issue_comment_url":"https://api.github.com/repos/dgebhard/aufgabe4/issues/comments{/number}","contents_url":"https://api.github.com/repos/dgebhard/aufgabe4/contents/{+path}","compare_url":"https://api.github.com/repos/dgebhard/aufgabe4/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dgebhard/aufgabe4/merges","archive_url":"https://api.github.com/repos/dgebhard/aufgabe4/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dgebhard/aufgabe4/downloads","issues_url":"https://api.github.com/repos/dgebhard/aufgabe4/issues{/number}","pulls_url":"https://api.github.com/repos/dgebhard/aufgabe4/pulls{/number}","milestones_url":"https://api.github.com/repos/dgebhard/aufgabe4/milestones{/number}","notifications_url":"https://api.github.com/repos/dgebhard/aufgabe4/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dgebhard/aufgabe4/labels{/name}","releases_url":"https://api.github.com/repos/dgebhard/aufgabe4/releases{/id}","created_at":"2015-06-03T08:56:12Z","updated_at":"2015-06-03T08:56:12Z","pushed_at":"2015-06-04T12:53:27Z","git_url":"git://github.com/dgebhard/aufgabe4.git","ssh_url":"git@github.com:dgebhard/aufgabe4.git","clone_url":"https://github.com/dgebhard/aufgabe4.git","svn_url":"https://github.com/dgebhard/aufgabe4","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"dgebhard:master","ref":"master","sha":"827e55ef824d3754826d902456d0b0fc1a507e04","user":{"login":"dgebhard","id":12696453,"avatar_url":"https://avatars.githubusercontent.com/u/12696453?v=3","gravatar_id":"","url":"https://api.github.com/users/dgebhard","html_url":"https://github.com/dgebhard","followers_url":"https://api.github.com/users/dgebhard/followers","following_url":"https://api.github.com/users/dgebhard/following{/other_user}","gists_url":"https://api.github.com/users/dgebhard/gists{/gist_id}","starred_url":"https://api.github.com/users/dgebhard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgebhard/subscriptions","organizations_url":"https://api.github.com/users/dgebhard/orgs","repos_url":"https://api.github.com/users/dgebhard/repos","events_url":"https://api.github.com/users/dgebhard/events{/privacy}","received_events_url":"https://api.github.com/users/dgebhard/received_events","type":"User","site_admin":false},"repo":{"id":36791910,"name":"aufgabe4","full_name":"dgebhard/aufgabe4","owner":{"login":"dgebhard","id":12696453,"avatar_url":"https://avatars.githubusercontent.com/u/12696453?v=3","gravatar_id":"","url":"https://api.github.com/users/dgebhard","html_url":"https://github.com/dgebhard","followers_url":"https://api.github.com/users/dgebhard/followers","following_url":"https://api.github.com/users/dgebhard/following{/other_user}","gists_url":"https://api.github.com/users/dgebhard/gists{/gist_id}","starred_url":"https://api.github.com/users/dgebhard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgebhard/subscriptions","organizations_url":"https://api.github.com/users/dgebhard/orgs","repos_url":"https://api.github.com/users/dgebhard/repos","events_url":"https://api.github.com/users/dgebhard/events{/privacy}","received_events_url":"https://api.github.com/users/dgebhard/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dgebhard/aufgabe4","description":"","fork":false,"url":"https://api.github.com/repos/dgebhard/aufgabe4","forks_url":"https://api.github.com/repos/dgebhard/aufgabe4/forks","keys_url":"https://api.github.com/repos/dgebhard/aufgabe4/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dgebhard/aufgabe4/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dgebhard/aufgabe4/teams","hooks_url":"https://api.github.com/repos/dgebhard/aufgabe4/hooks","issue_events_url":"https://api.github.com/repos/dgebhard/aufgabe4/issues/events{/number}","events_url":"https://api.github.com/repos/dgebhard/aufgabe4/events","assignees_url":"https://api.github.com/repos/dgebhard/aufgabe4/assignees{/user}","branches_url":"https://api.github.com/repos/dgebhard/aufgabe4/branches{/branch}","tags_url":"https://api.github.com/repos/dgebhard/aufgabe4/tags","blobs_url":"https://api.github.com/repos/dgebhard/aufgabe4/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dgebhard/aufgabe4/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dgebhard/aufgabe4/git/refs{/sha}","trees_url":"https://api.github.com/repos/dgebhard/aufgabe4/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dgebhard/aufgabe4/statuses/{sha}","languages_url":"https://api.github.com/repos/dgebhard/aufgabe4/languages","stargazers_url":"https://api.github.com/repos/dgebhard/aufgabe4/stargazers","contributors_url":"https://api.github.com/repos/dgebhard/aufgabe4/contributors","subscribers_url":"https://api.github.com/repos/dgebhard/aufgabe4/subscribers","subscription_url":"https://api.github.com/repos/dgebhard/aufgabe4/subscription","commits_url":"https://api.github.com/repos/dgebhard/aufgabe4/commits{/sha}","git_commits_url":"https://api.github.com/repos/dgebhard/aufgabe4/git/commits{/sha}","comments_url":"https://api.github.com/repos/dgebhard/aufgabe4/comments{/number}","issue_comment_url":"https://api.github.com/repos/dgebhard/aufgabe4/issues/comments{/number}","contents_url":"https://api.github.com/repos/dgebhard/aufgabe4/contents/{+path}","compare_url":"https://api.github.com/repos/dgebhard/aufgabe4/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dgebhard/aufgabe4/merges","archive_url":"https://api.github.com/repos/dgebhard/aufgabe4/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dgebhard/aufgabe4/downloads","issues_url":"https://api.github.com/repos/dgebhard/aufgabe4/issues{/number}","pulls_url":"https://api.github.com/repos/dgebhard/aufgabe4/pulls{/number}","milestones_url":"https://api.github.com/repos/dgebhard/aufgabe4/milestones{/number}","notifications_url":"https://api.github.com/repos/dgebhard/aufgabe4/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dgebhard/aufgabe4/labels{/name}","releases_url":"https://api.github.com/repos/dgebhard/aufgabe4/releases{/id}","created_at":"2015-06-03T08:56:12Z","updated_at":"2015-06-03T08:56:12Z","pushed_at":"2015-06-04T12:53:27Z","git_url":"git://github.com/dgebhard/aufgabe4.git","ssh_url":"git@github.com:dgebhard/aufgabe4.git","clone_url":"https://github.com/dgebhard/aufgabe4.git","svn_url":"https://github.com/dgebhard/aufgabe4","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dgebhard/aufgabe4/pulls/1"},"html":{"href":"https://github.com/dgebhard/aufgabe4/pull/1"},"issue":{"href":"https://api.github.com/repos/dgebhard/aufgabe4/issues/1"},"comments":{"href":"https://api.github.com/repos/dgebhard/aufgabe4/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/dgebhard/aufgabe4/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/dgebhard/aufgabe4/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dgebhard/aufgabe4/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/dgebhard/aufgabe4/statuses/33fe8259e62e086539282962619b38526e87c3dc"}}}}