{"action":"created","issue":{"url":"https://api.github.com/repos/sschmid/Entitas-CSharp/issues/384","repository_url":"https://api.github.com/repos/sschmid/Entitas-CSharp","labels_url":"https://api.github.com/repos/sschmid/Entitas-CSharp/issues/384/labels{/name}","comments_url":"https://api.github.com/repos/sschmid/Entitas-CSharp/issues/384/comments","events_url":"https://api.github.com/repos/sschmid/Entitas-CSharp/issues/384/events","html_url":"https://github.com/sschmid/Entitas-CSharp/issues/384","id":222326764,"number":384,"title":"Entity array index.","user":{"login":"VladislavKostin","id":14858947,"avatar_url":"https://avatars1.githubusercontent.com/u/14858947?v=3","gravatar_id":"","url":"https://api.github.com/users/VladislavKostin","html_url":"https://github.com/VladislavKostin","followers_url":"https://api.github.com/users/VladislavKostin/followers","following_url":"https://api.github.com/users/VladislavKostin/following{/other_user}","gists_url":"https://api.github.com/users/VladislavKostin/gists{/gist_id}","starred_url":"https://api.github.com/users/VladislavKostin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VladislavKostin/subscriptions","organizations_url":"https://api.github.com/users/VladislavKostin/orgs","repos_url":"https://api.github.com/users/VladislavKostin/repos","events_url":"https://api.github.com/users/VladislavKostin/events{/privacy}","received_events_url":"https://api.github.com/users/VladislavKostin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-04-18T07:30:12Z","updated_at":"2017-04-18T08:04:03Z","closed_at":null,"body":"Are entity indexes currently working only as dictionary lookups? In some cases, anything short of an array is pretty bad for performance. (Example: building game with 2D - 3D arrays of blocks, games with a lot of pathfinding or querying of tile grid data.) \r\n\r\nCan Entitas generate arrays of entities to allow querying them? \r\n\r\nMaybe syntax would look like that:\r\n\r\n    [EntityArrayIndex(0)] \r\n    int x;\r\n    [EntityArrayIndex(1)] \r\n    int y;\r\n\r\nOr sometimes better like that:\r\n\r\n    public sealed class PositionComponent : IComponent\r\n    {\r\n        [EntityArrayIndex3] \r\n        IntVector3 value;\r\n    }\r\n\r\n    public struct IntVector3 : IArrayIndex3\r\n    {\r\n        public int x, y, z;\r\n        \r\n        public GetArrayIndex3 (out x, out y, out z)\r\n        {\r\n            x = this.x; \r\n            y = this.y;\r\n            z = this.z;\r\n        }\r\n    }\r\n\r\nWhich allows you to get 3D array index (in this case) from a component. Will generate method:\r\n\r\n    var e = GetEntityWithPosition(x, y, z)  var e = GetEntityWithPosition(new IntVector3(x, y, z));\r\n\r\nMaybe this is silly but here it is:\r\n\r\n    public struct IntVector3 : IArrayIndex3\r\n    {\r\n        public int x, y, z;\r\n        \r\n        public Entity IArrayIndex3:GetEntityFromArray3 (Entity[,,] entities)\r\n        {\r\n            return entities[x, y, z]\r\n        }\r\n    }\r\n\r\n\r\nSometimes you want to have more than one entity with the same index (which is possible with the current lookup system, as far as I understand) so maybe in those cases, an array can internally be an array of lists of entities, but I'm not sure how to differentiate between the two in API.\r\n\r\n    [ListArrayIndex(0)] vs [ArrayIndex(0)] (?)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/sschmid/Entitas-CSharp/issues/comments/294721734","html_url":"https://github.com/sschmid/Entitas-CSharp/issues/384#issuecomment-294721734","issue_url":"https://api.github.com/repos/sschmid/Entitas-CSharp/issues/384","id":294721734,"user":{"login":"VladislavKostin","id":14858947,"avatar_url":"https://avatars1.githubusercontent.com/u/14858947?v=3","gravatar_id":"","url":"https://api.github.com/users/VladislavKostin","html_url":"https://github.com/VladislavKostin","followers_url":"https://api.github.com/users/VladislavKostin/followers","following_url":"https://api.github.com/users/VladislavKostin/following{/other_user}","gists_url":"https://api.github.com/users/VladislavKostin/gists{/gist_id}","starred_url":"https://api.github.com/users/VladislavKostin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VladislavKostin/subscriptions","organizations_url":"https://api.github.com/users/VladislavKostin/orgs","repos_url":"https://api.github.com/users/VladislavKostin/repos","events_url":"https://api.github.com/users/VladislavKostin/events{/privacy}","received_events_url":"https://api.github.com/users/VladislavKostin/received_events","type":"User","site_admin":false},"created_at":"2017-04-18T08:04:03Z","updated_at":"2017-04-18T08:04:03Z","body":"Thank you. I'll look into it. I'm not actually gonna be using Entitas for a while until I finish my current game. I'm thinking about my next game, so I hope that maybe you'll find the time to implement this by then (prob 4 months at least)."}}
{"actor":{"display_login":"VladislavKostin"}}