{"action":"opened","issue":{"url":"https://api.github.com/repos/sschmid/Entitas-CSharp/issues/462","repository_url":"https://api.github.com/repos/sschmid/Entitas-CSharp","labels_url":"https://api.github.com/repos/sschmid/Entitas-CSharp/issues/462/labels{/name}","comments_url":"https://api.github.com/repos/sschmid/Entitas-CSharp/issues/462/comments","events_url":"https://api.github.com/repos/sschmid/Entitas-CSharp/issues/462/events","html_url":"https://github.com/sschmid/Entitas-CSharp/issues/462","id":256392166,"number":462,"title":"Suggestions required. Adding multiple identical components to the same entity","user":{"login":"PanCotzky","id":2769996,"avatar_url":"https://avatars1.githubusercontent.com/u/2769996?v=4","gravatar_id":"","url":"https://api.github.com/users/PanCotzky","html_url":"https://github.com/PanCotzky","followers_url":"https://api.github.com/users/PanCotzky/followers","following_url":"https://api.github.com/users/PanCotzky/following{/other_user}","gists_url":"https://api.github.com/users/PanCotzky/gists{/gist_id}","starred_url":"https://api.github.com/users/PanCotzky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PanCotzky/subscriptions","organizations_url":"https://api.github.com/users/PanCotzky/orgs","repos_url":"https://api.github.com/users/PanCotzky/repos","events_url":"https://api.github.com/users/PanCotzky/events{/privacy}","received_events_url":"https://api.github.com/users/PanCotzky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-08T23:04:47Z","updated_at":"2017-09-08T23:04:47Z","closed_at":null,"author_association":"NONE","body":"Hey!\r\n\r\nHere's the deal. I have a certain functionality that needs to be shared between multiple components within the same entity. For example I have a character that has Health, Mana, Stamina, different skills. I can make each of them separate objects but they all can get bonuses, buffs, debuffs in other words they share a lot of functionality. So, it would be wise to combine them into a single component type and then create a feature that processes each of them with the same logic. But as I can imagine I can't add the same component to an entity multiple times.\r\n\r\nAt this time i'm trying to solve this problem by creating multiple \"Property\" entities and binding them to the same \"Unit\" entity via \"UnitId\" and then getting them like this:\r\n\r\n```\r\nContexts.sharedInstance.gameState.GetEntitiesWithUnitOwner(entity.unit.Id)\r\n                    .Where(e => e.hasProperty && e.property.name == \"Health\");\r\n\r\n```\r\nor\r\n\r\n```\r\nContexts.sharedInstance.gameState.GetEntitiesWithResource(\"Health\")\r\n                    .Where(e => e.hasUnitOwner && e.unitOwner ==entity.unit.Id);\r\n```\r\n\r\nAs you can see both ways are clunky. I don't mind to adapt to them but may be I'm doing it the wrong way? Can you suggest some more straight forward way?\r\n\r\nThank you!"}}
{"actor":{"display_login":"PanCotzky"}}