class BaseEntity//Each class that wants to be entity has to inherit this
{
int EntityVAPosition;//Vertex array position for destruction or editing
};
class EntityManager
{
public:
void AddEntity(BaseEntity & entity, sf::Vector2f Pos, sf::Vecto2f TexPos);
void RemoveEntity(BaseEntity);
};
The thinking with this is that entities will be added and removed from the VertexArray thus the options are:1:Reconstruct the whole array each time that is doneYou could also think about different data structures/algorithms that operate on an array, e.g. if you sorted the entity vertices based on how long something gets used, thus you could ignore the first part of an array since they'd never get removed etc, but again this needs a lot of thinking, otherwise the overhead will be larger than simply removing stuff.
2:Have empty holes in VertexArray and keep track of them and when entity is added fill them up.
this will most likely be a vertex array holding first index of empty VertexArray position.
That being said, id like to get ideas from a tutorial on Entity manager using sfml.You might also want to look at Component Systems (http://stefan.boxbox.org/2012/11/14/game-development-design-1-the-component-system/), they are a different approach than the Object Oriented Systems, other than that, entity systems are really an abstract concept of which there are many, many tutorials on the internet. From there it's really not that hard to implement it with SFML, after all SFML is just a toolbox so you can create whatever you imagine. ;)
I went digging but i think the name of what i am looking for is not called "Entity manager".