{"action":"created","issue":{"url":"https://api.github.com/repos/sschmid/Entitas-CSharp/issues/210","repository_url":"https://api.github.com/repos/sschmid/Entitas-CSharp","labels_url":"https://api.github.com/repos/sschmid/Entitas-CSharp/issues/210/labels{/name}","comments_url":"https://api.github.com/repos/sschmid/Entitas-CSharp/issues/210/comments","events_url":"https://api.github.com/repos/sschmid/Entitas-CSharp/issues/210/events","html_url":"https://github.com/sschmid/Entitas-CSharp/issues/210","id":183473526,"number":210,"title":"Group Including more then just targeted type","user":{"login":"Eforen","id":725683,"avatar_url":"https://avatars.githubusercontent.com/u/725683?v=3","gravatar_id":"","url":"https://api.github.com/users/Eforen","html_url":"https://github.com/Eforen","followers_url":"https://api.github.com/users/Eforen/followers","following_url":"https://api.github.com/users/Eforen/following{/other_user}","gists_url":"https://api.github.com/users/Eforen/gists{/gist_id}","starred_url":"https://api.github.com/users/Eforen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eforen/subscriptions","organizations_url":"https://api.github.com/users/Eforen/orgs","repos_url":"https://api.github.com/users/Eforen/repos","events_url":"https://api.github.com/users/Eforen/events{/privacy}","received_events_url":"https://api.github.com/users/Eforen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-17T17:09:44Z","updated_at":"2016-10-17T18:30:33Z","closed_at":null,"body":"I get the same error with the commented out trigger and the active trigger I don't know what is going on... the error output clearly shows that the entities do not have GameBoard except for the first one...\r\n\r\nThe Error:\r\n```\r\nGroupSingleEntityException: Cannot get the single entity from Group(AllOf(GameBoard))!\r\nGroup contains 3 entities:\r\nEntity_2(*3)(GameBoard)\r\nEntity_114(*5)(Movable, PlanedPiece, Position)\r\nEntity_121(*5)(Movable, PlanedPiece, Position)\r\nEntitas.Group.GetSingleEntity () (at Assets/Libraries/Entitas/Group.cs:188)\r\nEntitas.Pool.get_gameBoardEntity () (at Assets/Sources/Generated/GameBoardComponentGeneratedExtension.cs:40)\r\nGameBoardSystem.Execute (System.Collections.Generic.List`1 entities) (at Assets/Sources/Features/GameBoard/GameBoardSystem.cs:21)\r\nEntitas.ReactiveSystem.Execute () (at Assets/Libraries/Entitas/ReactiveSystem.cs:134)\r\nEntitas.Unity.Visual\r\n```\r\n\r\nThe Code:\r\n```\r\nusing System.Collections.Generic;\r\nusing Entitas;\r\nusing UnityEngine;\r\n\r\npublic sealed class GameBoardSystem : ISetPool, IInitializeSystem, IReactiveSystem {\r\n\r\n    \r\n    //public TriggerOnEvent trigger { get { return CoreMatcher.GameBoard.OnEntityAdded(); } }\r\n    public TriggerOnEvent trigger { get { return Matcher.AllOf(CoreMatcher.GameBoard).NoneOf(CoreMatcher.Destroy).OnEntityAdded(); } }\r\n\r\n    Pool _pool;\r\n\r\n    public void SetPool(Pool pool) {\r\n        _pool = pool;\r\n    }\r\n\r\n    public void Initialize() {\r\n    }\r\n\r\n    public void Execute(List<Entity> entities) {\r\n        var gameBoard = _pool.gameBoardEntity.gameBoard;\r\n    }\r\n}\r\n```\r\n\r\n_Assets/Sources/Generated/GameBoardComponentGeneratedExtension.cs:_\r\n```\r\n//------------------------------------------------------------------------------\r\n// <auto-generated>\r\n//     This code was generated by Entitas.CodeGenerator.ComponentExtensionsGenerator.\r\n//\r\n//     Changes to this file may cause incorrect behavior and will be lost if\r\n//     the code is regenerated.\r\n// </auto-generated>\r\n//------------------------------------------------------------------------------\r\nusing Entitas;\r\n\r\nnamespace Entitas {\r\n\r\n    public partial class Entity {\r\n\r\n        public GameBoardComponent gameBoard { get { return (GameBoardComponent)GetComponent(CoreComponentIds.GameBoard); } }\r\n        public bool hasGameBoard { get { return HasComponent(CoreComponentIds.GameBoard); } }\r\n\r\n        public Entity AddGameBoard(int newColumns, int newRows) {\r\n            var component = CreateComponent<GameBoardComponent>(CoreComponentIds.GameBoard);\r\n            component.columns = newColumns;\r\n            component.rows = newRows;\r\n            return AddComponent(CoreComponentIds.GameBoard, component);\r\n        }\r\n\r\n        public Entity ReplaceGameBoard(int newColumns, int newRows) {\r\n            var component = CreateComponent<GameBoardComponent>(CoreComponentIds.GameBoard);\r\n            component.columns = newColumns;\r\n            component.rows = newRows;\r\n            ReplaceComponent(CoreComponentIds.GameBoard, component);\r\n            return this;\r\n        }\r\n\r\n        public Entity RemoveGameBoard() {\r\n            return RemoveComponent(CoreComponentIds.GameBoard);\r\n        }\r\n    }\r\n\r\n    public partial class Pool {\r\n\r\n        public Entity gameBoardEntity { get { return GetGroup(CoreMatcher.GameBoard).GetSingleEntity(); } }\r\n        public GameBoardComponent gameBoard { get { return gameBoardEntity.gameBoard; } }\r\n        public bool hasGameBoard { get { return gameBoardEntity != null; } }\r\n\r\n        public Entity SetGameBoard(int newColumns, int newRows) {\r\n            if(hasGameBoard) {\r\n                throw new EntitasException(\"Could not set gameBoard!\\n\" + this + \" already has an entity with GameBoardComponent!\",\r\n                    \"You should check if the pool already has a gameBoardEntity before setting it or use pool.ReplaceGameBoard().\");\r\n            }\r\n            var entity = CreateEntity();\r\n            entity.AddGameBoard(newColumns, newRows);\r\n            return entity;\r\n        }\r\n\r\n        public Entity ReplaceGameBoard(int newColumns, int newRows) {\r\n            var entity = gameBoardEntity;\r\n            if(entity == null) {\r\n                entity = SetGameBoard(newColumns, newRows);\r\n            } else {\r\n                entity.ReplaceGameBoard(newColumns, newRows);\r\n            }\r\n\r\n            return entity;\r\n        }\r\n\r\n        public void RemoveGameBoard() {\r\n            DestroyEntity(gameBoardEntity);\r\n        }\r\n    }\r\n}\r\n\r\n    public partial class CoreMatcher {\r\n\r\n        static IMatcher _matcherGameBoard;\r\n\r\n        public static IMatcher GameBoard {\r\n            get {\r\n                if(_matcherGameBoard == null) {\r\n                    var matcher = (Matcher)Matcher.AllOf(CoreComponentIds.GameBoard);\r\n                    matcher.componentNames = CoreComponentIds.componentNames;\r\n                    _matcherGameBoard = matcher;\r\n                }\r\n\r\n                return _matcherGameBoard;\r\n            }\r\n        }\r\n    }\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/sschmid/Entitas-CSharp/issues/comments/254292562","html_url":"https://github.com/sschmid/Entitas-CSharp/issues/210#issuecomment-254292562","issue_url":"https://api.github.com/repos/sschmid/Entitas-CSharp/issues/210","id":254292562,"user":{"login":"Eforen","id":725683,"avatar_url":"https://avatars.githubusercontent.com/u/725683?v=3","gravatar_id":"","url":"https://api.github.com/users/Eforen","html_url":"https://github.com/Eforen","followers_url":"https://api.github.com/users/Eforen/followers","following_url":"https://api.github.com/users/Eforen/following{/other_user}","gists_url":"https://api.github.com/users/Eforen/gists{/gist_id}","starred_url":"https://api.github.com/users/Eforen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eforen/subscriptions","organizations_url":"https://api.github.com/users/Eforen/orgs","repos_url":"https://api.github.com/users/Eforen/repos","events_url":"https://api.github.com/users/Eforen/events{/privacy}","received_events_url":"https://api.github.com/users/Eforen/received_events","type":"User","site_admin":false},"created_at":"2016-10-17T18:30:33Z","updated_at":"2016-10-17T18:30:33Z","body":"Found problem accidentally matching across multiple component id pools.\r\n\r\nFor anyone else with this issue Check your Generated ComponentIds files for example here I had CoreComponentIds.GameBoard = 4 and ComponentIds.Moveable = 4 thus they count as the same component for matching purposes. If you need help with yours feel free to comment here or @ me in your issue"}}
{"actor":{"display_login":"Eforen"}}