{"action":"created","comment":{"url":"https://api.github.com/repos/jorisoudejans/DooB/pulls/comments/42872657","id":42872657,"diff_hunk":"@@ -0,0 +1,109 @@\n+package doob.model;\n+\n+import doob.util.BoundsTuple;\n+\n+import java.util.Random;\n+\n+/**\n+ * A survival level.\n+ * Created by hidde on 10/21/15.\n+ */\n+public class SurvivalLevel extends Level {\n+\n+    private int nextWaveHP = 0;\n+    private static final int DIFFICULTY_TIME = 1000;\n+    private static final int SMALLEST_BALL_SIZE = 16;\n+    private static final int NUMBER_POSSIBLE_BALLS = 5;\n+    private BoundsTuple bounds;\n+\n+    /**\n+     * Init new level with size bounds.\n+     *\n+     * @param bounds width and height\n+     */\n+    public SurvivalLevel(BoundsTuple bounds) {\n+        super(bounds);\n+        this.bounds = bounds;\n+    }\n+\n+    @Override\n+    public void update() {\n+        super.update();\n+        double cTime = getCurrentTime();\n+        if (cTime > DIFFICULTY_TIME) {\n+            setCurrentTime(cTime - DIFFICULTY_TIME);\n+            nextWaveHP++;\n+        }\n+        if (totalBallHitpoints() <= nextWaveHP) {\n+            spawnBalls(System.currentTimeMillis());\n+        }\n+    }\n+\n+    /**\n+     * Adds one to time.\n+     * @return one\n+     */\n+    @Override\n+    protected int getTimeMutation() {","path":"src/main/java/doob/model/SurvivalLevel.java","position":47,"original_position":47,"commit_id":"157e6b65396ccc4b06ae4dbd808c44d83d3154f1","original_commit_id":"157e6b65396ccc4b06ae4dbd808c44d83d3154f1","user":{"login":"jorisoudejans","id":4869451,"avatar_url":"https://avatars.githubusercontent.com/u/4869451?v=3","gravatar_id":"","url":"https://api.github.com/users/jorisoudejans","html_url":"https://github.com/jorisoudejans","followers_url":"https://api.github.com/users/jorisoudejans/followers","following_url":"https://api.github.com/users/jorisoudejans/following{/other_user}","gists_url":"https://api.github.com/users/jorisoudejans/gists{/gist_id}","starred_url":"https://api.github.com/users/jorisoudejans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorisoudejans/subscriptions","organizations_url":"https://api.github.com/users/jorisoudejans/orgs","repos_url":"https://api.github.com/users/jorisoudejans/repos","events_url":"https://api.github.com/users/jorisoudejans/events{/privacy}","received_events_url":"https://api.github.com/users/jorisoudejans/received_events","type":"User","site_admin":false},"body":"Ah, that is the function that gets 1 or -1, depending on whether it is called from Level or SurvivalLevel. This way, we don't have to implement update() twice, just override the getTimeMutation method.","created_at":"2015-10-23T14:43:28Z","updated_at":"2015-10-23T14:43:28Z","html_url":"https://github.com/jorisoudejans/DooB/pull/49#discussion_r42872657","pull_request_url":"https://api.github.com/repos/jorisoudejans/DooB/pulls/49","_links":{"self":{"href":"https://api.github.com/repos/jorisoudejans/DooB/pulls/comments/42872657"},"html":{"href":"https://github.com/jorisoudejans/DooB/pull/49#discussion_r42872657"},"pull_request":{"href":"https://api.github.com/repos/jorisoudejans/DooB/pulls/49"}}},"pull_request":{"url":"https://api.github.com/repos/jorisoudejans/DooB/pulls/49","id":48441576,"html_url":"https://github.com/jorisoudejans/DooB/pull/49","diff_url":"https://github.com/jorisoudejans/DooB/pull/49.diff","patch_url":"https://github.com/jorisoudejans/DooB/pull/49.patch","issue_url":"https://api.github.com/repos/jorisoudejans/DooB/issues/49","number":49,"state":"open","locked":false,"title":"Levelview observer pattern","user":{"login":"hlycklama","id":2234838,"avatar_url":"https://avatars.githubusercontent.com/u/2234838?v=3","gravatar_id":"","url":"https://api.github.com/users/hlycklama","html_url":"https://github.com/hlycklama","followers_url":"https://api.github.com/users/hlycklama/followers","following_url":"https://api.github.com/users/hlycklama/following{/other_user}","gists_url":"https://api.github.com/users/hlycklama/gists{/gist_id}","starred_url":"https://api.github.com/users/hlycklama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hlycklama/subscriptions","organizations_url":"https://api.github.com/users/hlycklama/orgs","repos_url":"https://api.github.com/users/hlycklama/repos","events_url":"https://api.github.com/users/hlycklama/events{/privacy}","received_events_url":"https://api.github.com/users/hlycklama/received_events","type":"User","site_admin":false},"body":"Major refactoring of Level","created_at":"2015-10-22T10:35:13Z","updated_at":"2015-10-23T14:43:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76d0b8c5a7294cfc8fc727a28a78473a0de82cd9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jorisoudejans/DooB/pulls/49/commits","review_comments_url":"https://api.github.com/repos/jorisoudejans/DooB/pulls/49/comments","review_comment_url":"https://api.github.com/repos/jorisoudejans/DooB/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jorisoudejans/DooB/issues/49/comments","statuses_url":"https://api.github.com/repos/jorisoudejans/DooB/statuses/157e6b65396ccc4b06ae4dbd808c44d83d3154f1","head":{"label":"jorisoudejans:levelview_observer_pattern","ref":"levelview_observer_pattern","sha":"157e6b65396ccc4b06ae4dbd808c44d83d3154f1","user":{"login":"jorisoudejans","id":4869451,"avatar_url":"https://avatars.githubusercontent.com/u/4869451?v=3","gravatar_id":"","url":"https://api.github.com/users/jorisoudejans","html_url":"https://github.com/jorisoudejans","followers_url":"https://api.github.com/users/jorisoudejans/followers","following_url":"https://api.github.com/users/jorisoudejans/following{/other_user}","gists_url":"https://api.github.com/users/jorisoudejans/gists{/gist_id}","starred_url":"https://api.github.com/users/jorisoudejans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorisoudejans/subscriptions","organizations_url":"https://api.github.com/users/jorisoudejans/orgs","repos_url":"https://api.github.com/users/jorisoudejans/repos","events_url":"https://api.github.com/users/jorisoudejans/events{/privacy}","received_events_url":"https://api.github.com/users/jorisoudejans/received_events","type":"User","site_admin":false},"repo":{"id":41816075,"name":"DooB","full_name":"jorisoudejans/DooB","owner":{"login":"jorisoudejans","id":4869451,"avatar_url":"https://avatars.githubusercontent.com/u/4869451?v=3","gravatar_id":"","url":"https://api.github.com/users/jorisoudejans","html_url":"https://github.com/jorisoudejans","followers_url":"https://api.github.com/users/jorisoudejans/followers","following_url":"https://api.github.com/users/jorisoudejans/following{/other_user}","gists_url":"https://api.github.com/users/jorisoudejans/gists{/gist_id}","starred_url":"https://api.github.com/users/jorisoudejans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorisoudejans/subscriptions","organizations_url":"https://api.github.com/users/jorisoudejans/orgs","repos_url":"https://api.github.com/users/jorisoudejans/repos","events_url":"https://api.github.com/users/jorisoudejans/events{/privacy}","received_events_url":"https://api.github.com/users/jorisoudejans/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jorisoudejans/DooB","description":"Bouble Trouble game","fork":false,"url":"https://api.github.com/repos/jorisoudejans/DooB","forks_url":"https://api.github.com/repos/jorisoudejans/DooB/forks","keys_url":"https://api.github.com/repos/jorisoudejans/DooB/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jorisoudejans/DooB/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jorisoudejans/DooB/teams","hooks_url":"https://api.github.com/repos/jorisoudejans/DooB/hooks","issue_events_url":"https://api.github.com/repos/jorisoudejans/DooB/issues/events{/number}","events_url":"https://api.github.com/repos/jorisoudejans/DooB/events","assignees_url":"https://api.github.com/repos/jorisoudejans/DooB/assignees{/user}","branches_url":"https://api.github.com/repos/jorisoudejans/DooB/branches{/branch}","tags_url":"https://api.github.com/repos/jorisoudejans/DooB/tags","blobs_url":"https://api.github.com/repos/jorisoudejans/DooB/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jorisoudejans/DooB/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jorisoudejans/DooB/git/refs{/sha}","trees_url":"https://api.github.com/repos/jorisoudejans/DooB/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jorisoudejans/DooB/statuses/{sha}","languages_url":"https://api.github.com/repos/jorisoudejans/DooB/languages","stargazers_url":"https://api.github.com/repos/jorisoudejans/DooB/stargazers","contributors_url":"https://api.github.com/repos/jorisoudejans/DooB/contributors","subscribers_url":"https://api.github.com/repos/jorisoudejans/DooB/subscribers","subscription_url":"https://api.github.com/repos/jorisoudejans/DooB/subscription","commits_url":"https://api.github.com/repos/jorisoudejans/DooB/commits{/sha}","git_commits_url":"https://api.github.com/repos/jorisoudejans/DooB/git/commits{/sha}","comments_url":"https://api.github.com/repos/jorisoudejans/DooB/comments{/number}","issue_comment_url":"https://api.github.com/repos/jorisoudejans/DooB/issues/comments{/number}","contents_url":"https://api.github.com/repos/jorisoudejans/DooB/contents/{+path}","compare_url":"https://api.github.com/repos/jorisoudejans/DooB/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jorisoudejans/DooB/merges","archive_url":"https://api.github.com/repos/jorisoudejans/DooB/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jorisoudejans/DooB/downloads","issues_url":"https://api.github.com/repos/jorisoudejans/DooB/issues{/number}","pulls_url":"https://api.github.com/repos/jorisoudejans/DooB/pulls{/number}","milestones_url":"https://api.github.com/repos/jorisoudejans/DooB/milestones{/number}","notifications_url":"https://api.github.com/repos/jorisoudejans/DooB/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jorisoudejans/DooB/labels{/name}","releases_url":"https://api.github.com/repos/jorisoudejans/DooB/releases{/id}","created_at":"2015-09-02T17:33:31Z","updated_at":"2015-09-04T05:15:46Z","pushed_at":"2015-10-22T21:40:00Z","git_url":"git://github.com/jorisoudejans/DooB.git","ssh_url":"git@github.com:jorisoudejans/DooB.git","clone_url":"https://github.com/jorisoudejans/DooB.git","svn_url":"https://github.com/jorisoudejans/DooB","homepage":null,"size":8688,"stargazers_count":1,"watchers_count":1,"language":"Java","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":1,"default_branch":"master"}},"base":{"label":"jorisoudejans:master","ref":"master","sha":"8ee73ecf72ae29000f578ce0cb27eb6c00106bd2","user":{"login":"jorisoudejans","id":4869451,"avatar_url":"https://avatars.githubusercontent.com/u/4869451?v=3","gravatar_id":"","url":"https://api.github.com/users/jorisoudejans","html_url":"https://github.com/jorisoudejans","followers_url":"https://api.github.com/users/jorisoudejans/followers","following_url":"https://api.github.com/users/jorisoudejans/following{/other_user}","gists_url":"https://api.github.com/users/jorisoudejans/gists{/gist_id}","starred_url":"https://api.github.com/users/jorisoudejans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorisoudejans/subscriptions","organizations_url":"https://api.github.com/users/jorisoudejans/orgs","repos_url":"https://api.github.com/users/jorisoudejans/repos","events_url":"https://api.github.com/users/jorisoudejans/events{/privacy}","received_events_url":"https://api.github.com/users/jorisoudejans/received_events","type":"User","site_admin":false},"repo":{"id":41816075,"name":"DooB","full_name":"jorisoudejans/DooB","owner":{"login":"jorisoudejans","id":4869451,"avatar_url":"https://avatars.githubusercontent.com/u/4869451?v=3","gravatar_id":"","url":"https://api.github.com/users/jorisoudejans","html_url":"https://github.com/jorisoudejans","followers_url":"https://api.github.com/users/jorisoudejans/followers","following_url":"https://api.github.com/users/jorisoudejans/following{/other_user}","gists_url":"https://api.github.com/users/jorisoudejans/gists{/gist_id}","starred_url":"https://api.github.com/users/jorisoudejans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorisoudejans/subscriptions","organizations_url":"https://api.github.com/users/jorisoudejans/orgs","repos_url":"https://api.github.com/users/jorisoudejans/repos","events_url":"https://api.github.com/users/jorisoudejans/events{/privacy}","received_events_url":"https://api.github.com/users/jorisoudejans/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jorisoudejans/DooB","description":"Bouble Trouble game","fork":false,"url":"https://api.github.com/repos/jorisoudejans/DooB","forks_url":"https://api.github.com/repos/jorisoudejans/DooB/forks","keys_url":"https://api.github.com/repos/jorisoudejans/DooB/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jorisoudejans/DooB/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jorisoudejans/DooB/teams","hooks_url":"https://api.github.com/repos/jorisoudejans/DooB/hooks","issue_events_url":"https://api.github.com/repos/jorisoudejans/DooB/issues/events{/number}","events_url":"https://api.github.com/repos/jorisoudejans/DooB/events","assignees_url":"https://api.github.com/repos/jorisoudejans/DooB/assignees{/user}","branches_url":"https://api.github.com/repos/jorisoudejans/DooB/branches{/branch}","tags_url":"https://api.github.com/repos/jorisoudejans/DooB/tags","blobs_url":"https://api.github.com/repos/jorisoudejans/DooB/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jorisoudejans/DooB/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jorisoudejans/DooB/git/refs{/sha}","trees_url":"https://api.github.com/repos/jorisoudejans/DooB/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jorisoudejans/DooB/statuses/{sha}","languages_url":"https://api.github.com/repos/jorisoudejans/DooB/languages","stargazers_url":"https://api.github.com/repos/jorisoudejans/DooB/stargazers","contributors_url":"https://api.github.com/repos/jorisoudejans/DooB/contributors","subscribers_url":"https://api.github.com/repos/jorisoudejans/DooB/subscribers","subscription_url":"https://api.github.com/repos/jorisoudejans/DooB/subscription","commits_url":"https://api.github.com/repos/jorisoudejans/DooB/commits{/sha}","git_commits_url":"https://api.github.com/repos/jorisoudejans/DooB/git/commits{/sha}","comments_url":"https://api.github.com/repos/jorisoudejans/DooB/comments{/number}","issue_comment_url":"https://api.github.com/repos/jorisoudejans/DooB/issues/comments{/number}","contents_url":"https://api.github.com/repos/jorisoudejans/DooB/contents/{+path}","compare_url":"https://api.github.com/repos/jorisoudejans/DooB/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jorisoudejans/DooB/merges","archive_url":"https://api.github.com/repos/jorisoudejans/DooB/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jorisoudejans/DooB/downloads","issues_url":"https://api.github.com/repos/jorisoudejans/DooB/issues{/number}","pulls_url":"https://api.github.com/repos/jorisoudejans/DooB/pulls{/number}","milestones_url":"https://api.github.com/repos/jorisoudejans/DooB/milestones{/number}","notifications_url":"https://api.github.com/repos/jorisoudejans/DooB/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jorisoudejans/DooB/labels{/name}","releases_url":"https://api.github.com/repos/jorisoudejans/DooB/releases{/id}","created_at":"2015-09-02T17:33:31Z","updated_at":"2015-09-04T05:15:46Z","pushed_at":"2015-10-22T21:40:00Z","git_url":"git://github.com/jorisoudejans/DooB.git","ssh_url":"git@github.com:jorisoudejans/DooB.git","clone_url":"https://github.com/jorisoudejans/DooB.git","svn_url":"https://github.com/jorisoudejans/DooB","homepage":null,"size":8688,"stargazers_count":1,"watchers_count":1,"language":"Java","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":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jorisoudejans/DooB/pulls/49"},"html":{"href":"https://github.com/jorisoudejans/DooB/pull/49"},"issue":{"href":"https://api.github.com/repos/jorisoudejans/DooB/issues/49"},"comments":{"href":"https://api.github.com/repos/jorisoudejans/DooB/issues/49/comments"},"review_comments":{"href":"https://api.github.com/repos/jorisoudejans/DooB/pulls/49/comments"},"review_comment":{"href":"https://api.github.com/repos/jorisoudejans/DooB/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jorisoudejans/DooB/pulls/49/commits"},"statuses":{"href":"https://api.github.com/repos/jorisoudejans/DooB/statuses/157e6b65396ccc4b06ae4dbd808c44d83d3154f1"}}}}