| 47 | } |
| 48 | |
| 49 | void UnitManager::destroy(UnitId unit) |
| 50 | { |
| 51 | CE_ASSERT(alive(unit), "Unit (%u.%u) has been destroyed already", unit.id(), unit.index()); |
| 52 | |
| 53 | const u32 idx = unit.index(); |
| 54 | ++_generation[idx]; |
| 55 | queue::push_back(_free_indices, idx); |
| 56 | |
| 57 | trigger_destroy_callbacks(unit); |
| 58 | } |
| 59 | |
| 60 | void UnitManager::register_destroy_callback(UnitDestroyCallback *udc) |
| 61 | { |
no test coverage detected