{"action":"opened","number":6,"pull_request":{"url":"https://api.github.com/repos/simon-whitehead/rspace/pulls/6","id":62629354,"html_url":"https://github.com/simon-whitehead/rspace/pull/6","diff_url":"https://github.com/simon-whitehead/rspace/pull/6.diff","patch_url":"https://github.com/simon-whitehead/rspace/pull/6.patch","issue_url":"https://api.github.com/repos/simon-whitehead/rspace/issues/6","number":6,"state":"open","locked":false,"title":"Code restructure","user":{"login":"simon-whitehead","id":2499070,"avatar_url":"https://avatars.githubusercontent.com/u/2499070?v=3","gravatar_id":"","url":"https://api.github.com/users/simon-whitehead","html_url":"https://github.com/simon-whitehead","followers_url":"https://api.github.com/users/simon-whitehead/followers","following_url":"https://api.github.com/users/simon-whitehead/following{/other_user}","gists_url":"https://api.github.com/users/simon-whitehead/gists{/gist_id}","starred_url":"https://api.github.com/users/simon-whitehead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simon-whitehead/subscriptions","organizations_url":"https://api.github.com/users/simon-whitehead/orgs","repos_url":"https://api.github.com/users/simon-whitehead/repos","events_url":"https://api.github.com/users/simon-whitehead/events{/privacy}","received_events_url":"https://api.github.com/users/simon-whitehead/received_events","type":"User","site_admin":false},"body":"This PR removes the attempt at being \"generic\" via Boxed `Entity` instances in favour of allowing each entity to know exactly what its drawing.\r\n\r\nWhat it used to be:\r\n\r\n* Window had a `Box<Scene>` for the current scene.\r\n* Each `Scene` took care of drawing a `Vec<Entity>`.\r\n* Each `Scene` took care of processing a `Vec<Entity>`.\r\n\r\nWhat problems this caused:\r\n\r\n* Every entity was forced down the same API when they don't actually act the same way.\r\n* Every entity had to notify the scene about an event _the exact same way_. This would have caused us to add many non-generic events to the `engine` module anyway.\r\n\r\nWhat it now is:\r\n\r\n* Window still has a `Box<Scene>`. Scenes are easy to handle.. they're either there or they aren't.\r\n* Each `Scene` now renders exactly what it needs. This means the `GameScene` owns a `Player` instance, a `Vec<Bullet>`, a `Vec<Explosion>`, etc.\r\n* Each entity can now return their own results from their `process` methods independently of each other. This means a `BulletResult::Delete` can remove a bullet from the `Scene`, a `PlayerResult::Died` can return a `SceneResult::ChangeScene` event up to the window for a \"Game Over\", etc.\r\n\r\nPros:\r\n\r\n* Easy to reason about the code.\r\n\r\nCons:\r\n\r\n* The engine isn't _quite_ as modular as it originally may have been had we successfully implemented the generic model. I don't think this is a bit issue though.","created_at":"2016-03-12T03:13:21Z","updated_at":"2016-03-12T03:13:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/simon-whitehead/rspace/pulls/6/commits","review_comments_url":"https://api.github.com/repos/simon-whitehead/rspace/pulls/6/comments","review_comment_url":"https://api.github.com/repos/simon-whitehead/rspace/pulls/comments{/number}","comments_url":"https://api.github.com/repos/simon-whitehead/rspace/issues/6/comments","statuses_url":"https://api.github.com/repos/simon-whitehead/rspace/statuses/65fe703f07c39e305be3e83d0e47c1ae81adaf45","head":{"label":"simon-whitehead:structure-change","ref":"structure-change","sha":"65fe703f07c39e305be3e83d0e47c1ae81adaf45","user":{"login":"simon-whitehead","id":2499070,"avatar_url":"https://avatars.githubusercontent.com/u/2499070?v=3","gravatar_id":"","url":"https://api.github.com/users/simon-whitehead","html_url":"https://github.com/simon-whitehead","followers_url":"https://api.github.com/users/simon-whitehead/followers","following_url":"https://api.github.com/users/simon-whitehead/following{/other_user}","gists_url":"https://api.github.com/users/simon-whitehead/gists{/gist_id}","starred_url":"https://api.github.com/users/simon-whitehead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simon-whitehead/subscriptions","organizations_url":"https://api.github.com/users/simon-whitehead/orgs","repos_url":"https://api.github.com/users/simon-whitehead/repos","events_url":"https://api.github.com/users/simon-whitehead/events{/privacy}","received_events_url":"https://api.github.com/users/simon-whitehead/received_events","type":"User","site_admin":false},"repo":{"id":53185376,"name":"rspace","full_name":"simon-whitehead/rspace","owner":{"login":"simon-whitehead","id":2499070,"avatar_url":"https://avatars.githubusercontent.com/u/2499070?v=3","gravatar_id":"","url":"https://api.github.com/users/simon-whitehead","html_url":"https://github.com/simon-whitehead","followers_url":"https://api.github.com/users/simon-whitehead/followers","following_url":"https://api.github.com/users/simon-whitehead/following{/other_user}","gists_url":"https://api.github.com/users/simon-whitehead/gists{/gist_id}","starred_url":"https://api.github.com/users/simon-whitehead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simon-whitehead/subscriptions","organizations_url":"https://api.github.com/users/simon-whitehead/orgs","repos_url":"https://api.github.com/users/simon-whitehead/repos","events_url":"https://api.github.com/users/simon-whitehead/events{/privacy}","received_events_url":"https://api.github.com/users/simon-whitehead/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/simon-whitehead/rspace","description":"A top-down space shooter written in Rust","fork":false,"url":"https://api.github.com/repos/simon-whitehead/rspace","forks_url":"https://api.github.com/repos/simon-whitehead/rspace/forks","keys_url":"https://api.github.com/repos/simon-whitehead/rspace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simon-whitehead/rspace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simon-whitehead/rspace/teams","hooks_url":"https://api.github.com/repos/simon-whitehead/rspace/hooks","issue_events_url":"https://api.github.com/repos/simon-whitehead/rspace/issues/events{/number}","events_url":"https://api.github.com/repos/simon-whitehead/rspace/events","assignees_url":"https://api.github.com/repos/simon-whitehead/rspace/assignees{/user}","branches_url":"https://api.github.com/repos/simon-whitehead/rspace/branches{/branch}","tags_url":"https://api.github.com/repos/simon-whitehead/rspace/tags","blobs_url":"https://api.github.com/repos/simon-whitehead/rspace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simon-whitehead/rspace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simon-whitehead/rspace/git/refs{/sha}","trees_url":"https://api.github.com/repos/simon-whitehead/rspace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simon-whitehead/rspace/statuses/{sha}","languages_url":"https://api.github.com/repos/simon-whitehead/rspace/languages","stargazers_url":"https://api.github.com/repos/simon-whitehead/rspace/stargazers","contributors_url":"https://api.github.com/repos/simon-whitehead/rspace/contributors","subscribers_url":"https://api.github.com/repos/simon-whitehead/rspace/subscribers","subscription_url":"https://api.github.com/repos/simon-whitehead/rspace/subscription","commits_url":"https://api.github.com/repos/simon-whitehead/rspace/commits{/sha}","git_commits_url":"https://api.github.com/repos/simon-whitehead/rspace/git/commits{/sha}","comments_url":"https://api.github.com/repos/simon-whitehead/rspace/comments{/number}","issue_comment_url":"https://api.github.com/repos/simon-whitehead/rspace/issues/comments{/number}","contents_url":"https://api.github.com/repos/simon-whitehead/rspace/contents/{+path}","compare_url":"https://api.github.com/repos/simon-whitehead/rspace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simon-whitehead/rspace/merges","archive_url":"https://api.github.com/repos/simon-whitehead/rspace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simon-whitehead/rspace/downloads","issues_url":"https://api.github.com/repos/simon-whitehead/rspace/issues{/number}","pulls_url":"https://api.github.com/repos/simon-whitehead/rspace/pulls{/number}","milestones_url":"https://api.github.com/repos/simon-whitehead/rspace/milestones{/number}","notifications_url":"https://api.github.com/repos/simon-whitehead/rspace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simon-whitehead/rspace/labels{/name}","releases_url":"https://api.github.com/repos/simon-whitehead/rspace/releases{/id}","deployments_url":"https://api.github.com/repos/simon-whitehead/rspace/deployments","created_at":"2016-03-05T05:28:34Z","updated_at":"2016-03-05T05:28:51Z","pushed_at":"2016-03-12T03:13:22Z","git_url":"git://github.com/simon-whitehead/rspace.git","ssh_url":"git@github.com:simon-whitehead/rspace.git","clone_url":"https://github.com/simon-whitehead/rspace.git","svn_url":"https://github.com/simon-whitehead/rspace","homepage":null,"size":10823,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"simon-whitehead:master","ref":"master","sha":"759fddf09fc163b9deec4c09a55821f6494193ba","user":{"login":"simon-whitehead","id":2499070,"avatar_url":"https://avatars.githubusercontent.com/u/2499070?v=3","gravatar_id":"","url":"https://api.github.com/users/simon-whitehead","html_url":"https://github.com/simon-whitehead","followers_url":"https://api.github.com/users/simon-whitehead/followers","following_url":"https://api.github.com/users/simon-whitehead/following{/other_user}","gists_url":"https://api.github.com/users/simon-whitehead/gists{/gist_id}","starred_url":"https://api.github.com/users/simon-whitehead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simon-whitehead/subscriptions","organizations_url":"https://api.github.com/users/simon-whitehead/orgs","repos_url":"https://api.github.com/users/simon-whitehead/repos","events_url":"https://api.github.com/users/simon-whitehead/events{/privacy}","received_events_url":"https://api.github.com/users/simon-whitehead/received_events","type":"User","site_admin":false},"repo":{"id":53185376,"name":"rspace","full_name":"simon-whitehead/rspace","owner":{"login":"simon-whitehead","id":2499070,"avatar_url":"https://avatars.githubusercontent.com/u/2499070?v=3","gravatar_id":"","url":"https://api.github.com/users/simon-whitehead","html_url":"https://github.com/simon-whitehead","followers_url":"https://api.github.com/users/simon-whitehead/followers","following_url":"https://api.github.com/users/simon-whitehead/following{/other_user}","gists_url":"https://api.github.com/users/simon-whitehead/gists{/gist_id}","starred_url":"https://api.github.com/users/simon-whitehead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simon-whitehead/subscriptions","organizations_url":"https://api.github.com/users/simon-whitehead/orgs","repos_url":"https://api.github.com/users/simon-whitehead/repos","events_url":"https://api.github.com/users/simon-whitehead/events{/privacy}","received_events_url":"https://api.github.com/users/simon-whitehead/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/simon-whitehead/rspace","description":"A top-down space shooter written in Rust","fork":false,"url":"https://api.github.com/repos/simon-whitehead/rspace","forks_url":"https://api.github.com/repos/simon-whitehead/rspace/forks","keys_url":"https://api.github.com/repos/simon-whitehead/rspace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simon-whitehead/rspace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simon-whitehead/rspace/teams","hooks_url":"https://api.github.com/repos/simon-whitehead/rspace/hooks","issue_events_url":"https://api.github.com/repos/simon-whitehead/rspace/issues/events{/number}","events_url":"https://api.github.com/repos/simon-whitehead/rspace/events","assignees_url":"https://api.github.com/repos/simon-whitehead/rspace/assignees{/user}","branches_url":"https://api.github.com/repos/simon-whitehead/rspace/branches{/branch}","tags_url":"https://api.github.com/repos/simon-whitehead/rspace/tags","blobs_url":"https://api.github.com/repos/simon-whitehead/rspace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simon-whitehead/rspace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simon-whitehead/rspace/git/refs{/sha}","trees_url":"https://api.github.com/repos/simon-whitehead/rspace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simon-whitehead/rspace/statuses/{sha}","languages_url":"https://api.github.com/repos/simon-whitehead/rspace/languages","stargazers_url":"https://api.github.com/repos/simon-whitehead/rspace/stargazers","contributors_url":"https://api.github.com/repos/simon-whitehead/rspace/contributors","subscribers_url":"https://api.github.com/repos/simon-whitehead/rspace/subscribers","subscription_url":"https://api.github.com/repos/simon-whitehead/rspace/subscription","commits_url":"https://api.github.com/repos/simon-whitehead/rspace/commits{/sha}","git_commits_url":"https://api.github.com/repos/simon-whitehead/rspace/git/commits{/sha}","comments_url":"https://api.github.com/repos/simon-whitehead/rspace/comments{/number}","issue_comment_url":"https://api.github.com/repos/simon-whitehead/rspace/issues/comments{/number}","contents_url":"https://api.github.com/repos/simon-whitehead/rspace/contents/{+path}","compare_url":"https://api.github.com/repos/simon-whitehead/rspace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simon-whitehead/rspace/merges","archive_url":"https://api.github.com/repos/simon-whitehead/rspace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simon-whitehead/rspace/downloads","issues_url":"https://api.github.com/repos/simon-whitehead/rspace/issues{/number}","pulls_url":"https://api.github.com/repos/simon-whitehead/rspace/pulls{/number}","milestones_url":"https://api.github.com/repos/simon-whitehead/rspace/milestones{/number}","notifications_url":"https://api.github.com/repos/simon-whitehead/rspace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simon-whitehead/rspace/labels{/name}","releases_url":"https://api.github.com/repos/simon-whitehead/rspace/releases{/id}","deployments_url":"https://api.github.com/repos/simon-whitehead/rspace/deployments","created_at":"2016-03-05T05:28:34Z","updated_at":"2016-03-05T05:28:51Z","pushed_at":"2016-03-12T03:13:22Z","git_url":"git://github.com/simon-whitehead/rspace.git","ssh_url":"git@github.com:simon-whitehead/rspace.git","clone_url":"https://github.com/simon-whitehead/rspace.git","svn_url":"https://github.com/simon-whitehead/rspace","homepage":null,"size":10823,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/simon-whitehead/rspace/pulls/6"},"html":{"href":"https://github.com/simon-whitehead/rspace/pull/6"},"issue":{"href":"https://api.github.com/repos/simon-whitehead/rspace/issues/6"},"comments":{"href":"https://api.github.com/repos/simon-whitehead/rspace/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/simon-whitehead/rspace/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/simon-whitehead/rspace/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/simon-whitehead/rspace/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/simon-whitehead/rspace/statuses/65fe703f07c39e305be3e83d0e47c1ae81adaf45"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":40,"deletions":75,"changed_files":9}}