void HiddenSniper::activateUpdate() { ShootObject::update(); checkIfShooted(); if (_status != HIDDEN_SNIPER_HIDE) { if (_shootedBullet == nullptr) { _shootedBullet = shoot(); } else if (checkCounter(HIDDEN_SNIPER_SHOOT_TIME)) { _status = HiddenSniperStatus::HIDDEN_SNIPER_HIDE; suspend(); } } }
int main() { FILE *fDb,*fDb2; int ch; checkCounter(fDb,fDb2); while(1) { printf("\n1.Show Present State of RTL\n"); printf("2.Show IO Stack\n"); printf("3.Feed Catridges\n"); printf("4.Drive Prosessing\n"); printf("5.Unload Catridges\n"); printf("6.Reset RTL\n"); printf("7.Close\n\n"); printf("Enter the choice\n"); scanf("%d",&ch); switch(ch) { case 1:showRTL(fDb,fDb2); break; case 2:showRTLwIO(fDb,fDb2); break; case 3:feedTape(fDb,fDb2); break; case 4:driveProcess(); break; case 5:unLoad(fDb,fDb2); break; case 6:initialize(fDb,fDb2); break; case 7:exit(0); break; default:printf("Wrong choice\n"); break; } } return 0; }
void HiddenSniper::waitUpdate() { if (Default::computeDistance(_target->getPosition(), _position) <= HIDDEN_SNIPER_SHOOT_DISTANCE) if (checkCounter(HIDDEN_SNIPER_RELOAD_TIME)) activate(); }