{"action":"created","comment":{"url":"https://api.github.com/repos/Nimelrian/Project-Onyx/pulls/comments/35800657","id":35800657,"diff_hunk":"@@ -0,0 +1,149 @@\n+#include \"World.hpp\"\n+#include \"../entities/CharacterEntity.hpp\"\n+\n+/*#####\n+# free functions\n+#####*/\n+namespace\n+{\n+\ttemplate <class Vector>\n+\tvoid getEntities(const std::vector<std::unique_ptr<sim::Entity>>& _entities, Vector& _result)\n+\t{\n+\t\t_result.resize(_entities.size());\n+\t\tfor (std::size_t i = 0; i < _result.size(); ++i)\n+\t\t\t_result[i] = _entities[i].get();\n+\t}\n+\n+\ttemplate <class Vector>\n+\tvoid getEntities(const std::vector<std::unique_ptr<sim::Entity>>& _entities, Vector& _result, sim::World::UnaryPredicateEntity _func)\n+\t{\n+\t\tfor (auto& entity : _entities)\n+\t\t{\n+\t\t\tif (!_func || _func(entity.get()))\n+\t\t\t\t_result.push_back(entity.get());\n+\t\t}\n+\t}\n+}\n+\n+/*#####\n+# World\n+#####*/\n+namespace sim\n+{\n+\tWorld::World()\n+\t{\n+\t\tcreateEntity<CharacterEntity>(true, sf::Vector3i(), 0, \"\", 0, 0);\n+\t}\n+\n+\tvoid World::update(int _simulationStep)\n+\t{\n+\t\t// update entities\n+\t\tfor (auto entity : m_UpdateList)\n+\t\t{\n+\t\t\tif (entity)\n+\t\t\t\tentity->update(_simulationStep);\n+\t\t}\n+\n+\t\t// remove all nullptr from update list\n+\t\tm_UpdateList.erase(std::remove_if(m_UpdateList.begin(), m_UpdateList.end(), [](const Entity* _entity){\n+\t\t\treturn _entity == nullptr;\n+\t\t}), m_UpdateList.end());\n+\t}\n+\n+\tvoid World::addEntity(EntityPtr&& _entity, bool _update)\n+\t{\n+\t\tm_Entities.push_back(std::move(_entity));\n+\t\tauto entity = m_Entities.back().get();\n+\t\tentity->setWorld(this);\n+\t\tif (_update)\n+\t\t\tregisterForUpdate(*entity);\n+\t}\n+\n+\tvoid World::eraseEntity(Entity& _entity)\n+\t{\n+\t\tassert(_entity.getWorld() == this);\n+\n+\t\tsf::Lock lock(m_EntityListMutex);","path":"src/Simulation/core/World.cpp","position":66,"original_position":66,"commit_id":"82b353d19e4da296f3c303c5c524bf04084e6d8b","original_commit_id":"82b353d19e4da296f3c303c5c524bf04084e6d8b","user":{"login":"Nimelrian","id":8960836,"avatar_url":"https://avatars.githubusercontent.com/u/8960836?v=3","gravatar_id":"","url":"https://api.github.com/users/Nimelrian","html_url":"https://github.com/Nimelrian","followers_url":"https://api.github.com/users/Nimelrian/followers","following_url":"https://api.github.com/users/Nimelrian/following{/other_user}","gists_url":"https://api.github.com/users/Nimelrian/gists{/gist_id}","starred_url":"https://api.github.com/users/Nimelrian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nimelrian/subscriptions","organizations_url":"https://api.github.com/users/Nimelrian/orgs","repos_url":"https://api.github.com/users/Nimelrian/repos","events_url":"https://api.github.com/users/Nimelrian/events{/privacy}","received_events_url":"https://api.github.com/users/Nimelrian/received_events","type":"User","site_admin":false},"body":"Statt der SFML Threading Klassen den C++11 <thread> Header nutzen.","created_at":"2015-07-29T19:21:23Z","updated_at":"2015-07-29T19:21:23Z","html_url":"https://github.com/Nimelrian/Project-Onyx/pull/38#discussion_r35800657","pull_request_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/pulls/38","_links":{"self":{"href":"https://api.github.com/repos/Nimelrian/Project-Onyx/pulls/comments/35800657"},"html":{"href":"https://github.com/Nimelrian/Project-Onyx/pull/38#discussion_r35800657"},"pull_request":{"href":"https://api.github.com/repos/Nimelrian/Project-Onyx/pulls/38"}}},"pull_request":{"url":"https://api.github.com/repos/Nimelrian/Project-Onyx/pulls/38","id":40918200,"html_url":"https://github.com/Nimelrian/Project-Onyx/pull/38","diff_url":"https://github.com/Nimelrian/Project-Onyx/pull/38.diff","patch_url":"https://github.com/Nimelrian/Project-Onyx/pull/38.patch","issue_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/issues/38","number":38,"state":"open","locked":false,"title":"Feature/entities","user":{"login":"anti-freak","id":761844,"avatar_url":"https://avatars.githubusercontent.com/u/761844?v=3","gravatar_id":"","url":"https://api.github.com/users/anti-freak","html_url":"https://github.com/anti-freak","followers_url":"https://api.github.com/users/anti-freak/followers","following_url":"https://api.github.com/users/anti-freak/following{/other_user}","gists_url":"https://api.github.com/users/anti-freak/gists{/gist_id}","starred_url":"https://api.github.com/users/anti-freak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anti-freak/subscriptions","organizations_url":"https://api.github.com/users/anti-freak/orgs","repos_url":"https://api.github.com/users/anti-freak/repos","events_url":"https://api.github.com/users/anti-freak/events{/privacy}","received_events_url":"https://api.github.com/users/anti-freak/received_events","type":"User","site_admin":false},"body":"Wie bereits schon erwähnt, die folgenden Basics sind drin:\r\n- Entity Baukastensystem (Entity base class und andere vererbbare Komponenten (Locatable, Movable, etc.)\r\n- World Klasse als Owner für alle Entities\r\n- Entities können sich für updates an- und abmelden\r\n- grundlegende Dokumentation für die wichtigen Schnittstellen (World und Entity)","created_at":"2015-07-27T15:50:57Z","updated_at":"2015-07-29T19:21:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"62110eae172136a43b648ad9c64e9e35a9295506","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/pulls/38/commits","review_comments_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/pulls/38/comments","review_comment_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/issues/38/comments","statuses_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/statuses/82b353d19e4da296f3c303c5c524bf04084e6d8b","head":{"label":"Nimelrian:feature/entities","ref":"feature/entities","sha":"82b353d19e4da296f3c303c5c524bf04084e6d8b","user":{"login":"Nimelrian","id":8960836,"avatar_url":"https://avatars.githubusercontent.com/u/8960836?v=3","gravatar_id":"","url":"https://api.github.com/users/Nimelrian","html_url":"https://github.com/Nimelrian","followers_url":"https://api.github.com/users/Nimelrian/followers","following_url":"https://api.github.com/users/Nimelrian/following{/other_user}","gists_url":"https://api.github.com/users/Nimelrian/gists{/gist_id}","starred_url":"https://api.github.com/users/Nimelrian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nimelrian/subscriptions","organizations_url":"https://api.github.com/users/Nimelrian/orgs","repos_url":"https://api.github.com/users/Nimelrian/repos","events_url":"https://api.github.com/users/Nimelrian/events{/privacy}","received_events_url":"https://api.github.com/users/Nimelrian/received_events","type":"User","site_admin":false},"repo":{"id":36465130,"name":"Project-Onyx","full_name":"Nimelrian/Project-Onyx","owner":{"login":"Nimelrian","id":8960836,"avatar_url":"https://avatars.githubusercontent.com/u/8960836?v=3","gravatar_id":"","url":"https://api.github.com/users/Nimelrian","html_url":"https://github.com/Nimelrian","followers_url":"https://api.github.com/users/Nimelrian/followers","following_url":"https://api.github.com/users/Nimelrian/following{/other_user}","gists_url":"https://api.github.com/users/Nimelrian/gists{/gist_id}","starred_url":"https://api.github.com/users/Nimelrian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nimelrian/subscriptions","organizations_url":"https://api.github.com/users/Nimelrian/orgs","repos_url":"https://api.github.com/users/Nimelrian/repos","events_url":"https://api.github.com/users/Nimelrian/events{/privacy}","received_events_url":"https://api.github.com/users/Nimelrian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Nimelrian/Project-Onyx","description":"","fork":false,"url":"https://api.github.com/repos/Nimelrian/Project-Onyx","forks_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/forks","keys_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/teams","hooks_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/hooks","issue_events_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/issues/events{/number}","events_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/events","assignees_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/assignees{/user}","branches_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/branches{/branch}","tags_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/tags","blobs_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/statuses/{sha}","languages_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/languages","stargazers_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/stargazers","contributors_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/contributors","subscribers_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/subscribers","subscription_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/subscription","commits_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/contents/{+path}","compare_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/merges","archive_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/downloads","issues_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/issues{/number}","pulls_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/pulls{/number}","milestones_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/milestones{/number}","notifications_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/labels{/name}","releases_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/releases{/id}","created_at":"2015-05-28T20:45:47Z","updated_at":"2015-07-05T19:23:25Z","pushed_at":"2015-07-28T15:58:52Z","git_url":"git://github.com/Nimelrian/Project-Onyx.git","ssh_url":"git@github.com:Nimelrian/Project-Onyx.git","clone_url":"https://github.com/Nimelrian/Project-Onyx.git","svn_url":"https://github.com/Nimelrian/Project-Onyx","homepage":null,"size":9321,"stargazers_count":7,"watchers_count":7,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":30,"forks":0,"open_issues":30,"watchers":7,"default_branch":"master"}},"base":{"label":"Nimelrian:master","ref":"master","sha":"4976fb33f9a817861b399d5c795866aca2083a86","user":{"login":"Nimelrian","id":8960836,"avatar_url":"https://avatars.githubusercontent.com/u/8960836?v=3","gravatar_id":"","url":"https://api.github.com/users/Nimelrian","html_url":"https://github.com/Nimelrian","followers_url":"https://api.github.com/users/Nimelrian/followers","following_url":"https://api.github.com/users/Nimelrian/following{/other_user}","gists_url":"https://api.github.com/users/Nimelrian/gists{/gist_id}","starred_url":"https://api.github.com/users/Nimelrian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nimelrian/subscriptions","organizations_url":"https://api.github.com/users/Nimelrian/orgs","repos_url":"https://api.github.com/users/Nimelrian/repos","events_url":"https://api.github.com/users/Nimelrian/events{/privacy}","received_events_url":"https://api.github.com/users/Nimelrian/received_events","type":"User","site_admin":false},"repo":{"id":36465130,"name":"Project-Onyx","full_name":"Nimelrian/Project-Onyx","owner":{"login":"Nimelrian","id":8960836,"avatar_url":"https://avatars.githubusercontent.com/u/8960836?v=3","gravatar_id":"","url":"https://api.github.com/users/Nimelrian","html_url":"https://github.com/Nimelrian","followers_url":"https://api.github.com/users/Nimelrian/followers","following_url":"https://api.github.com/users/Nimelrian/following{/other_user}","gists_url":"https://api.github.com/users/Nimelrian/gists{/gist_id}","starred_url":"https://api.github.com/users/Nimelrian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nimelrian/subscriptions","organizations_url":"https://api.github.com/users/Nimelrian/orgs","repos_url":"https://api.github.com/users/Nimelrian/repos","events_url":"https://api.github.com/users/Nimelrian/events{/privacy}","received_events_url":"https://api.github.com/users/Nimelrian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Nimelrian/Project-Onyx","description":"","fork":false,"url":"https://api.github.com/repos/Nimelrian/Project-Onyx","forks_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/forks","keys_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/teams","hooks_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/hooks","issue_events_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/issues/events{/number}","events_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/events","assignees_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/assignees{/user}","branches_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/branches{/branch}","tags_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/tags","blobs_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/statuses/{sha}","languages_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/languages","stargazers_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/stargazers","contributors_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/contributors","subscribers_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/subscribers","subscription_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/subscription","commits_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/contents/{+path}","compare_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/merges","archive_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/downloads","issues_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/issues{/number}","pulls_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/pulls{/number}","milestones_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/milestones{/number}","notifications_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/labels{/name}","releases_url":"https://api.github.com/repos/Nimelrian/Project-Onyx/releases{/id}","created_at":"2015-05-28T20:45:47Z","updated_at":"2015-07-05T19:23:25Z","pushed_at":"2015-07-28T15:58:52Z","git_url":"git://github.com/Nimelrian/Project-Onyx.git","ssh_url":"git@github.com:Nimelrian/Project-Onyx.git","clone_url":"https://github.com/Nimelrian/Project-Onyx.git","svn_url":"https://github.com/Nimelrian/Project-Onyx","homepage":null,"size":9321,"stargazers_count":7,"watchers_count":7,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":30,"forks":0,"open_issues":30,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Nimelrian/Project-Onyx/pulls/38"},"html":{"href":"https://github.com/Nimelrian/Project-Onyx/pull/38"},"issue":{"href":"https://api.github.com/repos/Nimelrian/Project-Onyx/issues/38"},"comments":{"href":"https://api.github.com/repos/Nimelrian/Project-Onyx/issues/38/comments"},"review_comments":{"href":"https://api.github.com/repos/Nimelrian/Project-Onyx/pulls/38/comments"},"review_comment":{"href":"https://api.github.com/repos/Nimelrian/Project-Onyx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Nimelrian/Project-Onyx/pulls/38/commits"},"statuses":{"href":"https://api.github.com/repos/Nimelrian/Project-Onyx/statuses/82b353d19e4da296f3c303c5c524bf04084e6d8b"}}}}