{"action":"created","issue":{"url":"https://api.github.com/repos/craftworkgames/MonoGame.Extended/issues/576","repository_url":"https://api.github.com/repos/craftworkgames/MonoGame.Extended","labels_url":"https://api.github.com/repos/craftworkgames/MonoGame.Extended/issues/576/labels{/name}","comments_url":"https://api.github.com/repos/craftworkgames/MonoGame.Extended/issues/576/comments","events_url":"https://api.github.com/repos/craftworkgames/MonoGame.Extended/issues/576/events","html_url":"https://github.com/craftworkgames/MonoGame.Extended/issues/576","id":386323995,"node_id":"MDU6SXNzdWUzODYzMjM5OTU=","number":576,"title":"[Entities][branch:develop] Remove WorldBuilder, Publicize World instance methods","user":{"login":"captkirk88","id":6296457,"node_id":"MDQ6VXNlcjYyOTY0NTc=","avatar_url":"https://avatars1.githubusercontent.com/u/6296457?v=4","gravatar_id":"","url":"https://api.github.com/users/captkirk88","html_url":"https://github.com/captkirk88","followers_url":"https://api.github.com/users/captkirk88/followers","following_url":"https://api.github.com/users/captkirk88/following{/other_user}","gists_url":"https://api.github.com/users/captkirk88/gists{/gist_id}","starred_url":"https://api.github.com/users/captkirk88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/captkirk88/subscriptions","organizations_url":"https://api.github.com/users/captkirk88/orgs","repos_url":"https://api.github.com/users/captkirk88/repos","events_url":"https://api.github.com/users/captkirk88/events{/privacy}","received_events_url":"https://api.github.com/users/captkirk88/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-11-30T19:42:24Z","updated_at":"2018-12-06T10:36:56Z","closed_at":"2018-12-03T18:04:04Z","author_association":"NONE","body":"WorldBuilder currently has a very limited function in the develop branch.  I think it is redundant considering World#RegisterSystem doesn't do anything particularly heavy that would require it to be restricted.  Having the ability to add systems and remove them at the programmers discretion should be considered.\r\n\r\nAdding a way to get all components related to a entity would also be nice.  I did that in my own version but have not tested the performance implications.  It involved modifying the abstract ComponentMapper to contain a abstract Get method and adding the below method to ComponentManager\r\n```csharp\r\n        public IEnumerable<object> GetComponents(int entityId)\r\n        {\r\n            for (var componentId = 0; componentId < _componentMappers.Count; componentId++)\r\n            {\r\n                var mapper = _componentMappers[componentId];\r\n                if (mapper?.Has(entityId) ?? false)\r\n                {\r\n                    yield return mapper.GetComponent(entityId); //GetComponent being a protected internal method in the abstract ComponentMapper class\r\n                }\r\n            }\r\n        }\r\n```\r\nIf there was a interface for Components themselves, this method could return a interface of IComponent.  But that could be considered redundant since you expect a component object regardless."},"comment":{"url":"https://api.github.com/repos/craftworkgames/MonoGame.Extended/issues/comments/444827118","html_url":"https://github.com/craftworkgames/MonoGame.Extended/issues/576#issuecomment-444827118","issue_url":"https://api.github.com/repos/craftworkgames/MonoGame.Extended/issues/576","id":444827118,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NDgyNzExOA==","user":{"login":"craftworkgames","id":3201643,"node_id":"MDQ6VXNlcjMyMDE2NDM=","avatar_url":"https://avatars1.githubusercontent.com/u/3201643?v=4","gravatar_id":"","url":"https://api.github.com/users/craftworkgames","html_url":"https://github.com/craftworkgames","followers_url":"https://api.github.com/users/craftworkgames/followers","following_url":"https://api.github.com/users/craftworkgames/following{/other_user}","gists_url":"https://api.github.com/users/craftworkgames/gists{/gist_id}","starred_url":"https://api.github.com/users/craftworkgames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craftworkgames/subscriptions","organizations_url":"https://api.github.com/users/craftworkgames/orgs","repos_url":"https://api.github.com/users/craftworkgames/repos","events_url":"https://api.github.com/users/craftworkgames/events{/privacy}","received_events_url":"https://api.github.com/users/craftworkgames/received_events","type":"User","site_admin":false},"created_at":"2018-12-06T10:36:56Z","updated_at":"2018-12-06T10:36:56Z","author_association":"OWNER","body":"> seems like you are reserved about letting the developer manage the performance implications of more advanced/useful features.\r\n\r\nJust to be clear, I'm not opposed to change. I'm just having a hard time understanding how these changes would help with anything. In fact, adding and removing systems at run-time is more likely to have a negative effect on performance because the garbage collector would kick in more often. A lot of the existing optimizations are designed to prevent exactly that from happening.\r\n\r\nTo do what you're asking I recommend using a flag inside the system to early exit if it doesn't need to do anything. This should provide the best possible performance balance between CPU cycles and memory management.\r\n\r\nLast but not least.. the design we've used is actually based off the very fast [artemis-odb java framework](https://github.com/junkdog/artemis-odb/wiki/World). Many of the same optimizations apply to C# but I was quite careful to consider the differences between how the Java and .NET garbage collector works."}}
{"actor":{"display_login":"craftworkgames"}}