box.hpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef _box_
  2. #define _box_
  3. #include "player.hpp"
  4. #include "rocket.hpp"
  5. #include "enemy.hpp"
  6. #include "boss.hpp"
  7. #include "wall.hpp"
  8. #include "powerup.hpp"
  9. #include "definitions.hpp"
  10. using std::cout; using std::endl;
  11. typedef std::list<bullet> b_list;
  12. typedef std::list<enemy> e_list;
  13. typedef std::vector<wall> w_vec;
  14. typedef std::list<rocket> r_list;
  15. class Box
  16. {
  17. public:
  18. Box() { clear(); }
  19. ~Box() {}
  20. int matrix[R][C]; //the position matrix
  21. void refresh(b_list&, b_list&, e_list&, player&, int &score, boss& boss1,w_vec &walls, b_list & powerups,r_list&); //empties, uploads, kills, empties again, uploads again matrix
  22. void print(); //prints the position matrix
  23. void clear(); //fills matrix with 0's
  24. void destroy(int X, int Y, b_list & bullets, b_list& bombs, e_list& enemies, b_list & powerups,r_list&); //destroys bullets, bombs and enemies in (X,Y)
  25. private:
  26. void upload(b_list & bullets, b_list& bombs, e_list& enemies, player& player1, boss& boss1,w_vec &walls, b_list & powerups,r_list&); //fills matrix with objects id's
  27. void kill(b_list & bullets, b_list& bombs, e_list& enemies, int &score, boss& spole,w_vec &walls, b_list & powerups, player & player1,r_list&); //checks where there's something to destroy
  28. };
  29. #endif