1

How to get just one of the already created entities? Example code;

void DrawSystem::update(entityx::EntityManager &es, entityx::EventManager &events, entityx::TimeDelta dt)
{
  es.each<Draw>
  (
    [this](entityx::Entity entity, Draw &draw)
    {
      //draw test
    }
  );
 }  

but this will loop through all Draw entities. How can I just get one Draw entity instead of the whole Draw entities?

MWiesner
  • 8,868
  • 11
  • 36
  • 70
share
  • 315
  • 2
  • 6
  • On what base you'd chose the entity? – skypjack Dec 26 '15 at 22:49
  • I'm using std::vector to store entity's elements of certain entity type, thus all of the entities of that particular type would point to the same vector. I'm trying to stop the looping through of each entity of type Draw (as an example) since the operation would be the same over and over again. I can't seem to find a way to get just a single entity of that particular type and to access the vector in the struct. – share Dec 26 '15 at 23:05

0 Answers0