Advertisement
czlowiekzgon

Untitled

Nov 21st, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. void Gang::addBoss(int where) {
  2. Boss *sup_ptr = new Boss[sizeBoss + 1];
  3.  
  4. for (int i = 0; i < sizeBoss + 1; i++) {
  5.  
  6. if (i == where) {
  7.  
  8. sup_ptr[i].initBoss();
  9. }
  10. else if (i > where) {
  11. sup_ptr[i] = ptrBoss[i - 1];
  12. }
  13. else {
  14. sup_ptr[i] = ptrBoss[i];
  15. }
  16.  
  17. }
  18.  
  19.  
  20. delete[] ptrBoss;
  21. ptrBoss = sup_ptr;
  22. ++sizeBoss;
  23. }
  24.  
  25.  
  26. Gang & Gang ::operator=(const Gang & g) {
  27.  
  28. ptrBoss = new Boss;
  29.  
  30. ptrBoss = g.ptrBoss;
  31.  
  32. return *this;
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement