Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. Creep *creep  = dynamic_cast<Creep*>(itemsInRange.at(0));
  2.     double lowestHp = creep->getCurrentHp();
  3.     int index = 0;
  4.     for(QList<QGraphicsItem*>::iterator it = itemsInRange.begin(); it != itemsInRange.end(); ++it, ++i) {
  5.         if(dynamic_cast<Creep*>(*it)->getCurrentHp() < lowestHp)
  6.             lowestHp = dynamic_cast<Creep*>(*it)->getCurrentHp();
  7.             index = i;
  8.      }
  9.  
  10.  
  11.     /* attack target with lowest hp*/
  12.     Antibody antibody;
  13.     antibody.setPos(towerMid);
  14.     map()->addItem(&antibody);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement