bool addBullet(int bulletType, float accelMag, float initialVelMag, vec3 direction, vec3 startPosition, float damage, int numberOfAcclUpdates) { if(wSoftEntities.size() == SOFT_ENTITIES_COUNT) return false; switch(bulletType) { case ID_BULLET_STRAIGHT: wSoftEntities.push_back(new StraightBulletEntity(accelMag, initialVelMag, direction, startPosition, damage, numberOfAcclUpdates)); std::cerr<<"Soft entities alive: "<<wSoftEntities.size()<<'\n'; break; case ID_BULLET_GRENADE: wSoftEntities.push_back(new GrenadeEntity(startPosition,direction)); break; default: throw new CException("Unknown bullet type given to addBullet()"); break; } return true; }
GameEntityList::iterator deleteSoftEntity(GameEntityList::iterator b) { delete *b; std::cerr<<"Soft entities alive: "<<wSoftEntities.size() - 1<<'\n'; return wSoftEntities.erase(b); }
bool addSoftEntity(GameEntity* g) { if(wSoftEntities.size() == SOFT_ENTITIES_COUNT) return false; wSoftEntities.push_back(g); return true; }
bool addEntity(GameEntity* g){ //Adds the passed GameEntity to the scene if(wEntities.size() == GAMEENTITY_COUNT) return false; wEntities.push_back(g); return true; }
bool addWall(Wall* w){ //Adds a wall to the scene if(wWalls.size() == WALL_COUNT) return false; wWalls.push_back(w); return true; }