So I am using an entity component system for the first time and while I like how it organizes the code, I am having issue understanding how to go about 1 thing at the moment. In case this matters, the game in a 2D turn based rogue like game.
So with the ECS, the player is just like any other entity and right now it does not have any component on it that is unique to the player. The issue is that I find that there are multiple use cases where I want to have access to the player's specific entity either outside of the ECS or within the context of a system that works on different entities. I will try to give a couple of concrete examples.
For example I have an inventory UI screen that is outside of the ECS but needs access to the player's inventory (to show the items). Another example would be the enemy path finding system which would need access to the player's locations (in order to both know if the player is within aggro range and to know the location to path find to). Another would be a world loot system that needs access to the players location (as only items within a certain range of the player should be rendered).
Most generic stuff I have read says that Entities should just hold components and nothing else. Now I generally don't apply patterns dogmatically if I think there is a valid use case to diverge slightly and this is one of those cases to me. What I am leaning towards is having a unique label that can be placed on the entity or have it null if not needed. This seems to be an edge as the only thing I think I am going to need this unique label for is the entity of the player (but who knows, other use cases might show up later).
Does this seem like an unreasonable way to implement an ECS? I am open to the idea that there might be other ways to handle the use cases where I need access to the player's specific entity but I can't think of one right now.