{"action":"created","comment":{"url":"https://api.github.com/repos/BlackDice/scent/pulls/comments/47428825","id":47428825,"diff_hunk":"@@ -38,13 +38,20 @@ Engine = function(initializer) {\n   engine = this;\n   isStarted = false;\n   engine.entityList = Lill.attach({});\n-  engine.addEntity = function(components) {\n-    var entity;\n-    entity = Entity(components);\n+  engine.addEntity = function(entity) {\n+    if (!entity) {\n+      entity = new Entity;\n+    } else if (entity instanceof Array) {\n+      log('adding Entity as an array of components should be done using `buildEntity` instead');","path":"lib/engine.js","position":11,"original_position":11,"commit_id":"1e652e47f034575163cc49967988d8d828fb26c8","original_commit_id":"1e652e47f034575163cc49967988d8d828fb26c8","user":{"login":"FredyC","id":1096340,"avatar_url":"https://avatars.githubusercontent.com/u/1096340?v=3","gravatar_id":"","url":"https://api.github.com/users/FredyC","html_url":"https://github.com/FredyC","followers_url":"https://api.github.com/users/FredyC/followers","following_url":"https://api.github.com/users/FredyC/following{/other_user}","gists_url":"https://api.github.com/users/FredyC/gists{/gist_id}","starred_url":"https://api.github.com/users/FredyC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FredyC/subscriptions","organizations_url":"https://api.github.com/users/FredyC/orgs","repos_url":"https://api.github.com/users/FredyC/repos","events_url":"https://api.github.com/users/FredyC/events{/privacy}","received_events_url":"https://api.github.com/users/FredyC/received_events","type":"User","site_admin":false},"body":"Please change it to: `Passing array of components to addEntity method is deprecated. Use buildEntity method instead.`","created_at":"2015-12-12T07:36:56Z","updated_at":"2015-12-12T07:36:56Z","html_url":"https://github.com/BlackDice/scent/pull/9#discussion_r47428825","pull_request_url":"https://api.github.com/repos/BlackDice/scent/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/BlackDice/scent/pulls/comments/47428825"},"html":{"href":"https://github.com/BlackDice/scent/pull/9#discussion_r47428825"},"pull_request":{"href":"https://api.github.com/repos/BlackDice/scent/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/BlackDice/scent/pulls/9","id":53394633,"html_url":"https://github.com/BlackDice/scent/pull/9","diff_url":"https://github.com/BlackDice/scent/pull/9.diff","patch_url":"https://github.com/BlackDice/scent/pull/9.patch","issue_url":"https://api.github.com/repos/BlackDice/scent/issues/9","number":9,"state":"open","locked":false,"title":"Adding existing entity to engine (issue #8)","user":{"login":"martikaljuve","id":130476,"avatar_url":"https://avatars.githubusercontent.com/u/130476?v=3","gravatar_id":"","url":"https://api.github.com/users/martikaljuve","html_url":"https://github.com/martikaljuve","followers_url":"https://api.github.com/users/martikaljuve/followers","following_url":"https://api.github.com/users/martikaljuve/following{/other_user}","gists_url":"https://api.github.com/users/martikaljuve/gists{/gist_id}","starred_url":"https://api.github.com/users/martikaljuve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martikaljuve/subscriptions","organizations_url":"https://api.github.com/users/martikaljuve/orgs","repos_url":"https://api.github.com/users/martikaljuve/repos","events_url":"https://api.github.com/users/martikaljuve/events{/privacy}","received_events_url":"https://api.github.com/users/martikaljuve/received_events","type":"User","site_admin":false},"body":"As discussed in issue #8, I changed `engine.addEntity(entityOrComponents)` to accept either an existing entity or an array of components. Maybe a separate method would be better?","created_at":"2015-12-11T13:52:28Z","updated_at":"2015-12-12T07:36:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"67ca4959960d1b0a476f9cfee92a0a94ad602bb0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/BlackDice/scent/pulls/9/commits","review_comments_url":"https://api.github.com/repos/BlackDice/scent/pulls/9/comments","review_comment_url":"https://api.github.com/repos/BlackDice/scent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BlackDice/scent/issues/9/comments","statuses_url":"https://api.github.com/repos/BlackDice/scent/statuses/1e652e47f034575163cc49967988d8d828fb26c8","head":{"label":"martikaljuve:add-existing-entity-to-engine","ref":"add-existing-entity-to-engine","sha":"1e652e47f034575163cc49967988d8d828fb26c8","user":{"login":"martikaljuve","id":130476,"avatar_url":"https://avatars.githubusercontent.com/u/130476?v=3","gravatar_id":"","url":"https://api.github.com/users/martikaljuve","html_url":"https://github.com/martikaljuve","followers_url":"https://api.github.com/users/martikaljuve/followers","following_url":"https://api.github.com/users/martikaljuve/following{/other_user}","gists_url":"https://api.github.com/users/martikaljuve/gists{/gist_id}","starred_url":"https://api.github.com/users/martikaljuve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martikaljuve/subscriptions","organizations_url":"https://api.github.com/users/martikaljuve/orgs","repos_url":"https://api.github.com/users/martikaljuve/repos","events_url":"https://api.github.com/users/martikaljuve/events{/privacy}","received_events_url":"https://api.github.com/users/martikaljuve/received_events","type":"User","site_admin":false},"repo":{"id":32988049,"name":"scent","full_name":"martikaljuve/scent","owner":{"login":"martikaljuve","id":130476,"avatar_url":"https://avatars.githubusercontent.com/u/130476?v=3","gravatar_id":"","url":"https://api.github.com/users/martikaljuve","html_url":"https://github.com/martikaljuve","followers_url":"https://api.github.com/users/martikaljuve/followers","following_url":"https://api.github.com/users/martikaljuve/following{/other_user}","gists_url":"https://api.github.com/users/martikaljuve/gists{/gist_id}","starred_url":"https://api.github.com/users/martikaljuve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martikaljuve/subscriptions","organizations_url":"https://api.github.com/users/martikaljuve/orgs","repos_url":"https://api.github.com/users/martikaljuve/repos","events_url":"https://api.github.com/users/martikaljuve/events{/privacy}","received_events_url":"https://api.github.com/users/martikaljuve/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/martikaljuve/scent","description":"Make a great game with fresh scent. It smells really good !","fork":true,"url":"https://api.github.com/repos/martikaljuve/scent","forks_url":"https://api.github.com/repos/martikaljuve/scent/forks","keys_url":"https://api.github.com/repos/martikaljuve/scent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/martikaljuve/scent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/martikaljuve/scent/teams","hooks_url":"https://api.github.com/repos/martikaljuve/scent/hooks","issue_events_url":"https://api.github.com/repos/martikaljuve/scent/issues/events{/number}","events_url":"https://api.github.com/repos/martikaljuve/scent/events","assignees_url":"https://api.github.com/repos/martikaljuve/scent/assignees{/user}","branches_url":"https://api.github.com/repos/martikaljuve/scent/branches{/branch}","tags_url":"https://api.github.com/repos/martikaljuve/scent/tags","blobs_url":"https://api.github.com/repos/martikaljuve/scent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/martikaljuve/scent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/martikaljuve/scent/git/refs{/sha}","trees_url":"https://api.github.com/repos/martikaljuve/scent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/martikaljuve/scent/statuses/{sha}","languages_url":"https://api.github.com/repos/martikaljuve/scent/languages","stargazers_url":"https://api.github.com/repos/martikaljuve/scent/stargazers","contributors_url":"https://api.github.com/repos/martikaljuve/scent/contributors","subscribers_url":"https://api.github.com/repos/martikaljuve/scent/subscribers","subscription_url":"https://api.github.com/repos/martikaljuve/scent/subscription","commits_url":"https://api.github.com/repos/martikaljuve/scent/commits{/sha}","git_commits_url":"https://api.github.com/repos/martikaljuve/scent/git/commits{/sha}","comments_url":"https://api.github.com/repos/martikaljuve/scent/comments{/number}","issue_comment_url":"https://api.github.com/repos/martikaljuve/scent/issues/comments{/number}","contents_url":"https://api.github.com/repos/martikaljuve/scent/contents/{+path}","compare_url":"https://api.github.com/repos/martikaljuve/scent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/martikaljuve/scent/merges","archive_url":"https://api.github.com/repos/martikaljuve/scent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/martikaljuve/scent/downloads","issues_url":"https://api.github.com/repos/martikaljuve/scent/issues{/number}","pulls_url":"https://api.github.com/repos/martikaljuve/scent/pulls{/number}","milestones_url":"https://api.github.com/repos/martikaljuve/scent/milestones{/number}","notifications_url":"https://api.github.com/repos/martikaljuve/scent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/martikaljuve/scent/labels{/name}","releases_url":"https://api.github.com/repos/martikaljuve/scent/releases{/id}","created_at":"2015-03-27T13:38:46Z","updated_at":"2015-04-10T14:40:00Z","pushed_at":"2015-12-11T18:47:50Z","git_url":"git://github.com/martikaljuve/scent.git","ssh_url":"git@github.com:martikaljuve/scent.git","clone_url":"https://github.com/martikaljuve/scent.git","svn_url":"https://github.com/martikaljuve/scent","homepage":"","size":273,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"BlackDice:master","ref":"master","sha":"b024b879ec2ad2b8c2581b33f9b1b43bc94777a4","user":{"login":"BlackDice","id":8406870,"avatar_url":"https://avatars.githubusercontent.com/u/8406870?v=3","gravatar_id":"","url":"https://api.github.com/users/BlackDice","html_url":"https://github.com/BlackDice","followers_url":"https://api.github.com/users/BlackDice/followers","following_url":"https://api.github.com/users/BlackDice/following{/other_user}","gists_url":"https://api.github.com/users/BlackDice/gists{/gist_id}","starred_url":"https://api.github.com/users/BlackDice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlackDice/subscriptions","organizations_url":"https://api.github.com/users/BlackDice/orgs","repos_url":"https://api.github.com/users/BlackDice/repos","events_url":"https://api.github.com/users/BlackDice/events{/privacy}","received_events_url":"https://api.github.com/users/BlackDice/received_events","type":"Organization","site_admin":false},"repo":{"id":27528618,"name":"scent","full_name":"BlackDice/scent","owner":{"login":"BlackDice","id":8406870,"avatar_url":"https://avatars.githubusercontent.com/u/8406870?v=3","gravatar_id":"","url":"https://api.github.com/users/BlackDice","html_url":"https://github.com/BlackDice","followers_url":"https://api.github.com/users/BlackDice/followers","following_url":"https://api.github.com/users/BlackDice/following{/other_user}","gists_url":"https://api.github.com/users/BlackDice/gists{/gist_id}","starred_url":"https://api.github.com/users/BlackDice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlackDice/subscriptions","organizations_url":"https://api.github.com/users/BlackDice/orgs","repos_url":"https://api.github.com/users/BlackDice/repos","events_url":"https://api.github.com/users/BlackDice/events{/privacy}","received_events_url":"https://api.github.com/users/BlackDice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BlackDice/scent","description":"Make a great game with fresh scent. It smells really good !","fork":false,"url":"https://api.github.com/repos/BlackDice/scent","forks_url":"https://api.github.com/repos/BlackDice/scent/forks","keys_url":"https://api.github.com/repos/BlackDice/scent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BlackDice/scent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BlackDice/scent/teams","hooks_url":"https://api.github.com/repos/BlackDice/scent/hooks","issue_events_url":"https://api.github.com/repos/BlackDice/scent/issues/events{/number}","events_url":"https://api.github.com/repos/BlackDice/scent/events","assignees_url":"https://api.github.com/repos/BlackDice/scent/assignees{/user}","branches_url":"https://api.github.com/repos/BlackDice/scent/branches{/branch}","tags_url":"https://api.github.com/repos/BlackDice/scent/tags","blobs_url":"https://api.github.com/repos/BlackDice/scent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BlackDice/scent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BlackDice/scent/git/refs{/sha}","trees_url":"https://api.github.com/repos/BlackDice/scent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BlackDice/scent/statuses/{sha}","languages_url":"https://api.github.com/repos/BlackDice/scent/languages","stargazers_url":"https://api.github.com/repos/BlackDice/scent/stargazers","contributors_url":"https://api.github.com/repos/BlackDice/scent/contributors","subscribers_url":"https://api.github.com/repos/BlackDice/scent/subscribers","subscription_url":"https://api.github.com/repos/BlackDice/scent/subscription","commits_url":"https://api.github.com/repos/BlackDice/scent/commits{/sha}","git_commits_url":"https://api.github.com/repos/BlackDice/scent/git/commits{/sha}","comments_url":"https://api.github.com/repos/BlackDice/scent/comments{/number}","issue_comment_url":"https://api.github.com/repos/BlackDice/scent/issues/comments{/number}","contents_url":"https://api.github.com/repos/BlackDice/scent/contents/{+path}","compare_url":"https://api.github.com/repos/BlackDice/scent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BlackDice/scent/merges","archive_url":"https://api.github.com/repos/BlackDice/scent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BlackDice/scent/downloads","issues_url":"https://api.github.com/repos/BlackDice/scent/issues{/number}","pulls_url":"https://api.github.com/repos/BlackDice/scent/pulls{/number}","milestones_url":"https://api.github.com/repos/BlackDice/scent/milestones{/number}","notifications_url":"https://api.github.com/repos/BlackDice/scent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BlackDice/scent/labels{/name}","releases_url":"https://api.github.com/repos/BlackDice/scent/releases{/id}","created_at":"2014-12-04T07:26:04Z","updated_at":"2015-09-25T01:30:20Z","pushed_at":"2015-12-11T18:47:51Z","git_url":"git://github.com/BlackDice/scent.git","ssh_url":"git@github.com:BlackDice/scent.git","clone_url":"https://github.com/BlackDice/scent.git","svn_url":"https://github.com/BlackDice/scent","homepage":"","size":624,"stargazers_count":8,"watchers_count":8,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BlackDice/scent/pulls/9"},"html":{"href":"https://github.com/BlackDice/scent/pull/9"},"issue":{"href":"https://api.github.com/repos/BlackDice/scent/issues/9"},"comments":{"href":"https://api.github.com/repos/BlackDice/scent/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/BlackDice/scent/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/BlackDice/scent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BlackDice/scent/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/BlackDice/scent/statuses/1e652e47f034575163cc49967988d8d828fb26c8"}}}}