| 139 | |
| 140 | #ifdef DEBUG |
| 141 | void CSpaceRestrictionComposition::test_correctness() |
| 142 | { |
| 143 | m_correct = true; |
| 144 | m_test_storage.clear(); |
| 145 | |
| 146 | { |
| 147 | RESTRICTIONS::iterator I = m_restrictions.begin(); |
| 148 | RESTRICTIONS::iterator E = m_restrictions.end(); |
| 149 | for (; I != E; ++I) |
| 150 | m_test_storage.insert(m_test_storage.end(), (*I)->object().m_test_storage.begin(), (*I)->object().m_test_storage.end()); |
| 151 | } |
| 152 | |
| 153 | { |
| 154 | std::sort(m_test_storage.begin(), m_test_storage.end()); |
| 155 | m_test_storage.erase(std::unique(m_test_storage.begin(), m_test_storage.end()), m_test_storage.end()); |
| 156 | } |
| 157 | |
| 158 | if (m_test_storage.empty()) |
| 159 | { |
| 160 | m_correct = false; |
| 161 | return; |
| 162 | } |
| 163 | |
| 164 | xr_vector<u32> nodes; |
| 165 | { |
| 166 | RESTRICTIONS::iterator I = m_restrictions.begin(); |
| 167 | RESTRICTIONS::iterator E = m_restrictions.end(); |
| 168 | for (; I != E; ++I) |
| 169 | { |
| 170 | VERIFY3(!(*I)->object().m_test_storage.empty(), "Restrictor has no border", *(*I)->object().name()); |
| 171 | nodes.clear(); |
| 172 | ai().level_graph().set_mask(border()); |
| 173 | ai().graph_engine().search(ai().level_graph(), (*I)->object().m_test_storage.back(), (*I)->object().m_test_storage.back(), &nodes, GraphEngineSpace::CFlooder()); |
| 174 | ai().level_graph().clear_mask(border()); |
| 175 | |
| 176 | if (nodes.size() == 65535) |
| 177 | m_correct = true; |
| 178 | else |
| 179 | m_correct = (m_test_storage.size() <= nodes.size()); |
| 180 | |
| 181 | if (!m_correct) |
| 182 | break; |
| 183 | } |
| 184 | } |
| 185 | } |
| 186 | #endif |
| 187 | |
| 188 | Fsphere CSpaceRestrictionComposition::sphere() const |
nothing calls this directly
no test coverage detected