int main(void) { std::cerr << "\n\nTEST: copy constructor\n"; std::cerr << "If you are reading this, something is wrong, copy constructor was deleted\n"; /// Create object with default constructor sicklms291s14::SickLMS291S14 laser1; sicklms291s14::SickLMS291S14 laser2("/dev/ttyusb0"); /// Assigning one object to another should generate compiler error /// because the overloaded assignment operator was deleted laser2 = laser1; return 0; }
void EnemyShipC::FireLaser() { if (GetTickCount() - lastShot > laserInterval) { Laser laser1(Device, Laser::YELLOW); Laser laser2(Device, Laser::YELLOW); laser1.SetRotation(rotationMatrix); laser1.TranslateV(position + (right * 0.9f)); laser1.SetOrientation(up, right, look); laser2.SetRotation(rotationMatrix); laser2.TranslateV(position - (right * 0.9f)); laser2.SetOrientation(up, right, look); lasers.push_back(laser1); lasers.push_back(laser2); Fire.Play(); lastShot = GetTickCount(); } else return; }