{"action":"created","comment":{"url":"https://api.github.com/repos/Sqarea/sqarea/pulls/comments/236088417","pull_request_review_id":178095625,"id":236088417,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjA4ODQxNw==","diff_hunk":"@@ -1,106 +1,109 @@\n-import * as PIXI from 'pixi.js'\n import { System, Entity } from 'src/core'\n-import { ShapeComponent, Transform, BoxShape } from 'src/components'\n-import { BOX_SHAPE, ComponentType } from 'src/components/types'\n-import { uuid } from 'src/utils'\n+import { EventManager, EventCallback } from './EventManager'\n \n+/**\n+ * The Engine keeps track of all ECS-related entities and systems.\n+ * It a singleton and should only be lazily instanced via the GetInstance() method.\n+ * @fires entity_added\n+ * @fires entity_removed\n+ * @fires system_added\n+ * @fires system_removed\n+ */\n export class Engine {\n   systems: Record<string, System> = {}\n   entities: Record<string, Entity> = {}\n-  engineObjects: Record<string, PIXI.Container> = {}\n-  app: PIXI.Application\n \n-  private static instance: Engine\n+  private static Instance: Engine\n+  private eventManager: EventManager = new EventManager()\n+  private pool: Entity[] = []\n \n-  private componentHandlers = {\n-    transform: this.handleTransform,\n-    shape: this.handleShape\n-  }\n-\n-  static getInstance(app: PIXI.Application): Engine {\n-    if (!Engine.instance) {\n-      Engine.instance = new Engine(app)\n+  static GetInstance(): Engine {","path":"src/core/Engine.ts","position":35,"original_position":35,"commit_id":"458fc02eea153fcc875d8e6a4e00e11919a9feeb","original_commit_id":"458fc02eea153fcc875d8e6a4e00e11919a9feeb","user":{"login":"NicoSantangelo","id":692077,"node_id":"MDQ6VXNlcjY5MjA3Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/692077?v=4","gravatar_id":"","url":"https://api.github.com/users/NicoSantangelo","html_url":"https://github.com/NicoSantangelo","followers_url":"https://api.github.com/users/NicoSantangelo/followers","following_url":"https://api.github.com/users/NicoSantangelo/following{/other_user}","gists_url":"https://api.github.com/users/NicoSantangelo/gists{/gist_id}","starred_url":"https://api.github.com/users/NicoSantangelo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NicoSantangelo/subscriptions","organizations_url":"https://api.github.com/users/NicoSantangelo/orgs","repos_url":"https://api.github.com/users/NicoSantangelo/repos","events_url":"https://api.github.com/users/NicoSantangelo/events{/privacy}","received_events_url":"https://api.github.com/users/NicoSantangelo/received_events","type":"User","site_admin":false},"body":"I'm not really used to static methods being uppercased, but I'm speaking from a front-end/old-fart js point of view. \r\nI don't really mind if we keep it consistent but I think it's worth considering if we ever decide to abstract the ECS part away, as other projects might be using this convention or the more js-based one","created_at":"2018-11-25T20:20:22Z","updated_at":"2018-11-25T20:20:23Z","html_url":"https://github.com/Sqarea/sqarea/pull/11#discussion_r236088417","pull_request_url":"https://api.github.com/repos/Sqarea/sqarea/pulls/11","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Sqarea/sqarea/pulls/comments/236088417"},"html":{"href":"https://github.com/Sqarea/sqarea/pull/11#discussion_r236088417"},"pull_request":{"href":"https://api.github.com/repos/Sqarea/sqarea/pulls/11"}},"in_reply_to_id":236070978},"pull_request":{"url":"https://api.github.com/repos/Sqarea/sqarea/pulls/11","id":232491005,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyNDkxMDA1","html_url":"https://github.com/Sqarea/sqarea/pull/11","diff_url":"https://github.com/Sqarea/sqarea/pull/11.diff","patch_url":"https://github.com/Sqarea/sqarea/pull/11.patch","issue_url":"https://api.github.com/repos/Sqarea/sqarea/issues/11","number":11,"state":"open","locked":false,"title":"WIP feat: entity children","user":{"login":"belohlavek","id":1307029,"node_id":"MDQ6VXNlcjEzMDcwMjk=","avatar_url":"https://avatars3.githubusercontent.com/u/1307029?v=4","gravatar_id":"","url":"https://api.github.com/users/belohlavek","html_url":"https://github.com/belohlavek","followers_url":"https://api.github.com/users/belohlavek/followers","following_url":"https://api.github.com/users/belohlavek/following{/other_user}","gists_url":"https://api.github.com/users/belohlavek/gists{/gist_id}","starred_url":"https://api.github.com/users/belohlavek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/belohlavek/subscriptions","organizations_url":"https://api.github.com/users/belohlavek/orgs","repos_url":"https://api.github.com/users/belohlavek/repos","events_url":"https://api.github.com/users/belohlavek/events{/privacy}","received_events_url":"https://api.github.com/users/belohlavek/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-20T23:22:21Z","updated_at":"2018-11-25T20:20:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c0cf9200128f94ee530f37d2539e0be9feb5b126","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1133376038,"node_id":"MDU6TGFiZWwxMTMzMzc2MDM4","url":"https://api.github.com/repos/Sqarea/sqarea/labels/Work%20in%20Progress","name":"Work in Progress","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Sqarea/sqarea/pulls/11/commits","review_comments_url":"https://api.github.com/repos/Sqarea/sqarea/pulls/11/comments","review_comment_url":"https://api.github.com/repos/Sqarea/sqarea/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Sqarea/sqarea/issues/11/comments","statuses_url":"https://api.github.com/repos/Sqarea/sqarea/statuses/458fc02eea153fcc875d8e6a4e00e11919a9feeb","head":{"label":"Sqarea:feat/entity-children","ref":"feat/entity-children","sha":"458fc02eea153fcc875d8e6a4e00e11919a9feeb","user":{"login":"Sqarea","id":45248771,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1MjQ4Nzcx","avatar_url":"https://avatars3.githubusercontent.com/u/45248771?v=4","gravatar_id":"","url":"https://api.github.com/users/Sqarea","html_url":"https://github.com/Sqarea","followers_url":"https://api.github.com/users/Sqarea/followers","following_url":"https://api.github.com/users/Sqarea/following{/other_user}","gists_url":"https://api.github.com/users/Sqarea/gists{/gist_id}","starred_url":"https://api.github.com/users/Sqarea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sqarea/subscriptions","organizations_url":"https://api.github.com/users/Sqarea/orgs","repos_url":"https://api.github.com/users/Sqarea/repos","events_url":"https://api.github.com/users/Sqarea/events{/privacy}","received_events_url":"https://api.github.com/users/Sqarea/received_events","type":"Organization","site_admin":false},"repo":{"id":158014616,"node_id":"MDEwOlJlcG9zaXRvcnkxNTgwMTQ2MTY=","name":"sqarea","full_name":"Sqarea/sqarea","private":false,"owner":{"login":"Sqarea","id":45248771,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1MjQ4Nzcx","avatar_url":"https://avatars3.githubusercontent.com/u/45248771?v=4","gravatar_id":"","url":"https://api.github.com/users/Sqarea","html_url":"https://github.com/Sqarea","followers_url":"https://api.github.com/users/Sqarea/followers","following_url":"https://api.github.com/users/Sqarea/following{/other_user}","gists_url":"https://api.github.com/users/Sqarea/gists{/gist_id}","starred_url":"https://api.github.com/users/Sqarea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sqarea/subscriptions","organizations_url":"https://api.github.com/users/Sqarea/orgs","repos_url":"https://api.github.com/users/Sqarea/repos","events_url":"https://api.github.com/users/Sqarea/events{/privacy}","received_events_url":"https://api.github.com/users/Sqarea/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Sqarea/sqarea","description":"A pixijs boilerplate","fork":false,"url":"https://api.github.com/repos/Sqarea/sqarea","forks_url":"https://api.github.com/repos/Sqarea/sqarea/forks","keys_url":"https://api.github.com/repos/Sqarea/sqarea/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sqarea/sqarea/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sqarea/sqarea/teams","hooks_url":"https://api.github.com/repos/Sqarea/sqarea/hooks","issue_events_url":"https://api.github.com/repos/Sqarea/sqarea/issues/events{/number}","events_url":"https://api.github.com/repos/Sqarea/sqarea/events","assignees_url":"https://api.github.com/repos/Sqarea/sqarea/assignees{/user}","branches_url":"https://api.github.com/repos/Sqarea/sqarea/branches{/branch}","tags_url":"https://api.github.com/repos/Sqarea/sqarea/tags","blobs_url":"https://api.github.com/repos/Sqarea/sqarea/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sqarea/sqarea/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sqarea/sqarea/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sqarea/sqarea/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sqarea/sqarea/statuses/{sha}","languages_url":"https://api.github.com/repos/Sqarea/sqarea/languages","stargazers_url":"https://api.github.com/repos/Sqarea/sqarea/stargazers","contributors_url":"https://api.github.com/repos/Sqarea/sqarea/contributors","subscribers_url":"https://api.github.com/repos/Sqarea/sqarea/subscribers","subscription_url":"https://api.github.com/repos/Sqarea/sqarea/subscription","commits_url":"https://api.github.com/repos/Sqarea/sqarea/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sqarea/sqarea/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sqarea/sqarea/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sqarea/sqarea/issues/comments{/number}","contents_url":"https://api.github.com/repos/Sqarea/sqarea/contents/{+path}","compare_url":"https://api.github.com/repos/Sqarea/sqarea/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sqarea/sqarea/merges","archive_url":"https://api.github.com/repos/Sqarea/sqarea/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sqarea/sqarea/downloads","issues_url":"https://api.github.com/repos/Sqarea/sqarea/issues{/number}","pulls_url":"https://api.github.com/repos/Sqarea/sqarea/pulls{/number}","milestones_url":"https://api.github.com/repos/Sqarea/sqarea/milestones{/number}","notifications_url":"https://api.github.com/repos/Sqarea/sqarea/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sqarea/sqarea/labels{/name}","releases_url":"https://api.github.com/repos/Sqarea/sqarea/releases{/id}","deployments_url":"https://api.github.com/repos/Sqarea/sqarea/deployments","created_at":"2018-11-17T18:49:07Z","updated_at":"2018-11-23T21:49:09Z","pushed_at":"2018-11-23T21:41:35Z","git_url":"git://github.com/Sqarea/sqarea.git","ssh_url":"git@github.com:Sqarea/sqarea.git","clone_url":"https://github.com/Sqarea/sqarea.git","svn_url":"https://github.com/Sqarea/sqarea","homepage":null,"size":140,"stargazers_count":1,"watchers_count":1,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":9,"license":null,"forks":0,"open_issues":9,"watchers":1,"default_branch":"master"}},"base":{"label":"Sqarea:master","ref":"master","sha":"bd45b2a3f15c84fdb4e63e2c522a48b1832c7c15","user":{"login":"Sqarea","id":45248771,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1MjQ4Nzcx","avatar_url":"https://avatars3.githubusercontent.com/u/45248771?v=4","gravatar_id":"","url":"https://api.github.com/users/Sqarea","html_url":"https://github.com/Sqarea","followers_url":"https://api.github.com/users/Sqarea/followers","following_url":"https://api.github.com/users/Sqarea/following{/other_user}","gists_url":"https://api.github.com/users/Sqarea/gists{/gist_id}","starred_url":"https://api.github.com/users/Sqarea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sqarea/subscriptions","organizations_url":"https://api.github.com/users/Sqarea/orgs","repos_url":"https://api.github.com/users/Sqarea/repos","events_url":"https://api.github.com/users/Sqarea/events{/privacy}","received_events_url":"https://api.github.com/users/Sqarea/received_events","type":"Organization","site_admin":false},"repo":{"id":158014616,"node_id":"MDEwOlJlcG9zaXRvcnkxNTgwMTQ2MTY=","name":"sqarea","full_name":"Sqarea/sqarea","private":false,"owner":{"login":"Sqarea","id":45248771,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1MjQ4Nzcx","avatar_url":"https://avatars3.githubusercontent.com/u/45248771?v=4","gravatar_id":"","url":"https://api.github.com/users/Sqarea","html_url":"https://github.com/Sqarea","followers_url":"https://api.github.com/users/Sqarea/followers","following_url":"https://api.github.com/users/Sqarea/following{/other_user}","gists_url":"https://api.github.com/users/Sqarea/gists{/gist_id}","starred_url":"https://api.github.com/users/Sqarea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sqarea/subscriptions","organizations_url":"https://api.github.com/users/Sqarea/orgs","repos_url":"https://api.github.com/users/Sqarea/repos","events_url":"https://api.github.com/users/Sqarea/events{/privacy}","received_events_url":"https://api.github.com/users/Sqarea/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Sqarea/sqarea","description":"A pixijs boilerplate","fork":false,"url":"https://api.github.com/repos/Sqarea/sqarea","forks_url":"https://api.github.com/repos/Sqarea/sqarea/forks","keys_url":"https://api.github.com/repos/Sqarea/sqarea/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sqarea/sqarea/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sqarea/sqarea/teams","hooks_url":"https://api.github.com/repos/Sqarea/sqarea/hooks","issue_events_url":"https://api.github.com/repos/Sqarea/sqarea/issues/events{/number}","events_url":"https://api.github.com/repos/Sqarea/sqarea/events","assignees_url":"https://api.github.com/repos/Sqarea/sqarea/assignees{/user}","branches_url":"https://api.github.com/repos/Sqarea/sqarea/branches{/branch}","tags_url":"https://api.github.com/repos/Sqarea/sqarea/tags","blobs_url":"https://api.github.com/repos/Sqarea/sqarea/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sqarea/sqarea/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sqarea/sqarea/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sqarea/sqarea/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sqarea/sqarea/statuses/{sha}","languages_url":"https://api.github.com/repos/Sqarea/sqarea/languages","stargazers_url":"https://api.github.com/repos/Sqarea/sqarea/stargazers","contributors_url":"https://api.github.com/repos/Sqarea/sqarea/contributors","subscribers_url":"https://api.github.com/repos/Sqarea/sqarea/subscribers","subscription_url":"https://api.github.com/repos/Sqarea/sqarea/subscription","commits_url":"https://api.github.com/repos/Sqarea/sqarea/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sqarea/sqarea/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sqarea/sqarea/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sqarea/sqarea/issues/comments{/number}","contents_url":"https://api.github.com/repos/Sqarea/sqarea/contents/{+path}","compare_url":"https://api.github.com/repos/Sqarea/sqarea/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sqarea/sqarea/merges","archive_url":"https://api.github.com/repos/Sqarea/sqarea/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sqarea/sqarea/downloads","issues_url":"https://api.github.com/repos/Sqarea/sqarea/issues{/number}","pulls_url":"https://api.github.com/repos/Sqarea/sqarea/pulls{/number}","milestones_url":"https://api.github.com/repos/Sqarea/sqarea/milestones{/number}","notifications_url":"https://api.github.com/repos/Sqarea/sqarea/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sqarea/sqarea/labels{/name}","releases_url":"https://api.github.com/repos/Sqarea/sqarea/releases{/id}","deployments_url":"https://api.github.com/repos/Sqarea/sqarea/deployments","created_at":"2018-11-17T18:49:07Z","updated_at":"2018-11-23T21:49:09Z","pushed_at":"2018-11-23T21:41:35Z","git_url":"git://github.com/Sqarea/sqarea.git","ssh_url":"git@github.com:Sqarea/sqarea.git","clone_url":"https://github.com/Sqarea/sqarea.git","svn_url":"https://github.com/Sqarea/sqarea","homepage":null,"size":140,"stargazers_count":1,"watchers_count":1,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":9,"license":null,"forks":0,"open_issues":9,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Sqarea/sqarea/pulls/11"},"html":{"href":"https://github.com/Sqarea/sqarea/pull/11"},"issue":{"href":"https://api.github.com/repos/Sqarea/sqarea/issues/11"},"comments":{"href":"https://api.github.com/repos/Sqarea/sqarea/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/Sqarea/sqarea/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/Sqarea/sqarea/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Sqarea/sqarea/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/Sqarea/sqarea/statuses/458fc02eea153fcc875d8e6a4e00e11919a9feeb"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"NicoSantangelo"}}