----------------------------------------------- DESTRUCTOR -----------------------------------------------
| 52 | } |
| 53 | //----------------------------------------------- DESTRUCTOR ----------------------------------------------- |
| 54 | GameImpl::~GameImpl() |
| 55 | { |
| 56 | this->initializeData(); |
| 57 | |
| 58 | // destroy all UnitImpl |
| 59 | for (UnitImpl* u : unitArray) |
| 60 | { |
| 61 | if (u) delete u; |
| 62 | } |
| 63 | unitArray.fill(nullptr); |
| 64 | |
| 65 | // destroy all PlayerImpl |
| 66 | for (int i = 0; i < std::extent<decltype(players)>::value; ++i) |
| 67 | { |
| 68 | if (players[i]) delete players[i]; |
| 69 | players[i] = nullptr; |
| 70 | } |
| 71 | |
| 72 | // destroy all bullets |
| 73 | for (BulletImpl* b : bulletArray) |
| 74 | { |
| 75 | if (b) delete b; |
| 76 | } |
| 77 | bulletArray.fill(nullptr); |
| 78 | } |
| 79 | //---------------------------------------- REFRESH SELECTION STATES ---------------------------------------- |
| 80 | void GameImpl::refreshSelectionStates() |
| 81 | { |
nothing calls this directly
no test coverage detected